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

Error when using dynamic imports in ember-auto-import #150

Open
benmurden opened this issue Nov 20, 2019 · 0 comments
Open

Error when using dynamic imports in ember-auto-import #150

benmurden opened this issue Nov 20, 2019 · 0 comments

Comments

@benmurden
Copy link

Dynamic import docs: https://github.com/ef4/ember-auto-import#dynamic-import

Produces the following error:

ERR app\components\my-component.js Transformation error
SyntaxError: 'import' and 'export' may only appear at the top level (15:4)
    at Parser.pp.raise (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\location.js:24:13)
    at Parser.pp.parseStatement (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:111:29)
    at Parser.parseStatement (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\plugins\flow.js:655:22)
    at Parser.pp.parseBlock (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\statement.js:442:21)
    at Parser.pp.parseFunctionBody (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\expression.js:747:22)
    at Parser.parseFunctionBody (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\plugins\flow.js:643:20)
    at Parser.pp.parseMethod (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\expression.js:717:8)
    at Parser.pp.parseObjPropValue (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\expression.js:658:23)
    at Parser.parseObjPropValue (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\plugins\flow.js:891:13)
    at Parser.pp.parseObj (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\ember-modules-codemod\node_modules\babel-core\node_modules\babylon\lib\parser\expression.js:640:10)

Environment

$ ember -v
ember-cli: 3.14.0
node: 10.16.0
os: win32 x64

$ ember-cli-update --version
0.45.0
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

No branches or pull requests

1 participant