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

babel-parser throws syntax error for import string names with flow plugin #12209

Closed
1 task done
sosukesuzuki opened this issue Oct 18, 2020 · 1 comment · Fixed by #12224
Closed
1 task done

babel-parser throws syntax error for import string names with flow plugin #12209

sosukesuzuki opened this issue Oct 18, 2020 · 1 comment · Fixed by #12224
Labels
area: flow i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser

Comments

@sosukesuzuki
Copy link
Member

sosukesuzuki commented Oct 18, 2020

Bug Report

  • I would like to work on a fix!

Current behavior

babel-parser throws syntax error Unexpected token (1:9) with moduleStringNames plugin and flow plugin. (REPL)
This happens on import only, export works fine. (REPL)

Input Code

import { "foo" as foo } from "module-a";

Expected behavior

No syntax error is thrown.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
Call parse directly.

const code = `import { "foo" as foo } from "module-a";`;
require("@babel/parser").parse(code, {
  sourceType: "module",
  plugins: ["moduleStringNames", "flow"],
});

Environment

Possible Solution

Additional context

Found from working on prettier/prettier#9408

@babel-bot
Copy link
Collaborator

Hey @sosukesuzuki! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: flow i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants