diff --git a/src/printer.js b/src/printer.js index 86705f64f..84d58d146 100644 --- a/src/printer.js +++ b/src/printer.js @@ -1351,7 +1351,7 @@ function genericPrintNoParens(path, options, print, args) { case "JSXText": throw new Error("JSXTest should be handled by JSXElement"); case "JSXEmptyExpression": - const requiresHardline = n.comments.some( + const requiresHardline = n.comments && n.comments.some( comment => comment.type === "Line" || comment.type === "CommentLine" );