Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dynamic imports #478

Open
hoschi opened this issue Mar 30, 2017 · 0 comments · May be fixed by millermedeiros/esformatter-parser#1
Open

Support dynamic imports #478

hoschi opened this issue Mar 30, 2017 · 0 comments · May be fixed by millermedeiros/esformatter-parser#1

Comments

@hoschi
Copy link

hoschi commented Mar 30, 2017

minimal.js

import('./myModule').then(myModule => console.log(myModule))

gives:

formatting > esformatter minimal.js
Error: minimal.js:1:6 Unexpected token, expected {
SyntaxError: Unexpected token, expected { (1:6)
    at Parser.pp$5.raise (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:4373:13)
    at Parser.pp.unexpected (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:1716:8)
    at Parser.pp.expect (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:1704:33)
    at Parser.pp$1.parseImportSpecifiers (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:2833:8)
    at Parser.parseImportSpecifiers (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:6080:13)
    at Parser.pp$1.parseImport (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:2803:10)
    at Parser.pp$1.parseStatement (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:1839:49)
    at Parser.parseStatement (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:5712:22)
    at Parser.pp$1.parseBlockBody (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:2223:21)
    at Parser.pp$1.parseTopLevel (/home/hoschi/repos/gis/formatting/node_modules/babylon/lib/index.js:1733:8)

which due to the old babylon version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant