You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get `Error: Comment was not printed' when using flow parser #2555
I've just started to use prettier in my react project.
However, I found that prettier raise an "Comment was not printed" error when I switch to use flow parser.
node version: 8.1.2
prettier version: 1.5.3
Here's a minimal example:
import(/**/'m');
The command and output:
$ prettier --parser flow poc/prettier/min.js
poc/prettier/min.js: Error: Comment "" was not printed. Please report this error!
at astComments.forEach.comment (/Users/liruimin/node_modules/prettier/index.js:13684:13)
at Array.forEach (native)
at ensureAllCommentsPrinted (/Users/liruimin/node_modules/prettier/index.js:13682:15)
at formatWithCursor (/Users/liruimin/node_modules/prettier/index.js:13720:3)
at Object.formatWithCursor (/Users/liruimin/node_modules/prettier/index.js:13942:12)
at format (/Users/liruimin/node_modules/prettier/bin/prettier.js:5524:19)
at filename (/Users/liruimin/node_modules/prettier/bin/prettier.js:5637:16)
at patterns.forEach.pattern (/Users/liruimin/node_modules/prettier/bin/prettier.js:5703:7)
at Array.forEach (native)
at eachFilename (/Users/liruimin/node_modules/prettier/bin/prettier.js:5698:12)
Activity
rkurbatov commentedon Sep 4, 2017
The same for 1.6.1 (and the same import() function example btw). I need comments inside of that function call to pass 'chunkName' to webpack2.
lydell commentedon Sep 4, 2017
@rkurbatov Luckily, there are workarounds until this is fixed: #1489 (comment)
Closing in favor of #1489 (seems like nobody has noticed the duplicate before).