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
When using dynamic imports, I am seeing the following parse errors:
$ ./node_modules/.bin/documentation build src/index.js -f html -o docs 10:00
SyntaxError: Unexpected token, expected { (8:8)
at Parser.pp$5.raise (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:4454:13)
at Parser.pp.unexpected (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:1761:8)
at Parser.pp.expect (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:1749:33)
at Parser.pp$1.parseImportSpecifiers (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:2898:8)
at Parser.parseImportSpecifiers (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:6310:13)
at Parser.pp$1.parseImport (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:2868:10)
at Parser.pp$1.parseStatement (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:1884:49)
at Parser.parseStatement (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:5910:22)
at Parser.pp$1.parseIfStatement (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:2059:26)
at Parser.pp$1.parseStatement (/Users/esturcke/projects/documentation-dynamic-import-bug/node_modules/babylon/lib/index.js:1846:19)
Okay, this one turned out to be simpler to fix than expected! There's an option in the babylon parser (which we use to parse JavaScript to an AST) called dynamicImport that was not enabled. I can enable it and fix this issue in a patch release.
When using dynamic imports, I am seeing the following parse errors:
The source code for
index.js
is:I've created a repo with the code that is failing to parse.
Is there a workaround and is this something that could be supported?
The text was updated successfully, but these errors were encountered: