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 babel-parser in dynamic imports #1041

Closed
falcoagustin opened this issue Jan 9, 2018 · 3 comments

Comments

@falcoagustin
Copy link

commented Jan 9, 2018

I'm using babel-eslint v6.1.2 along with standard v10.0.3 and I'm not able to bypass the error when doing dynamic imports, this way:

import('path/to/module').then(module => {
  //do Somthing
})

It raises error Parsing error: 'import' and 'export' may only appear at the top level. I tried using:

parsingOptions: {
    "AllowImportExportEverywhere": true
}

And still raises the error, had to ignore the file instead.

@ematipico

This comment has been minimized.

Copy link
Contributor

commented Jan 9, 2018

I don't think it's a standard related issue.
Have a look to this duplicate #751

@falcoagustin

This comment has been minimized.

Copy link
Author

commented Jan 9, 2018

@ematipico I agree, I should've posted on babel-eslint, but I spoke with @feross and told me to raise an issue here, if he confirms I can repost it there 😄

@feross

This comment has been minimized.

Copy link
Member

commented May 10, 2018

Using babel-eslint@8 and standard@11, I am unable to reproduce this issue. It lints import() perfectly fine as far as I can tell.

I'm going to assume that this issue has been fixed in the intervening major version releases.

@feross feross closed this May 10, 2018

@feross feross added the question label May 10, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.