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/parse@7.3.1(7.3.2) does not compile correctly? #9489

Closed
xiezhongfu opened this Issue Feb 11, 2019 · 5 comments

Comments

Projects
None yet
5 participants
@xiezhongfu
Copy link

xiezhongfu commented Feb 11, 2019

Bug Report

Current Behavior
@babel_parser@7.3.1, @babel_parser@7.3.2 does not know ${...} correctly.
@babel_parser@7.2.3 compile successfully

Babel Configuration (.babelrc, package.json, cli command)

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "targets": {
          "browsers": [
            "last 3 versions",
            "safari >= 7",
            "not ie <= 8"
          ]
        }
      }
    ],
    "@babel/react"
  ],
  "plugins": [
    "@babel/plugin-transform-runtime",
    "@babel/proposal-class-properties",
    "@babel/plugin-syntax-dynamic-import",
    [
      "import",
      {
        "libraryName": "antd",
        "style": true // `style: true` 会加载 less 文件
      }
    ],
    "react-hot-loader/babel"
  ]
}

Environment

  • Babel version(s): [^7.2.2]
  • Node/npm version: [Node 10.13.0/npm 6.4.1]
  • OS: [OSX 10.13.4, Windows 10, Windows 7]
  • Monorepo: [no]
  • How you are using Babel: [loader]

Additional context/Screenshots
image

how do I solve the problem temporarily
image

@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Feb 11, 2019

Hey @xiezhongfu! 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.

@danez danez self-assigned this Feb 11, 2019

@danez danez removed the i: bug label Feb 11, 2019

@danez

This comment has been minimized.

Copy link
Member

danez commented Feb 11, 2019

That error is weird. I'm not able to reproduce this yet. I wonder if there is some invisible unicode character that sneaked in front of the first ${. Can you check?

@xiezhongfu

This comment has been minimized.

Copy link
Author

xiezhongfu commented Feb 11, 2019

That error is weird. I'm not able to reproduce this yet. I wonder if there is some invisible unicode character that sneaked in front of the first ${. Can you check?

image

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

nicolo-ribaudo commented Feb 11, 2019

I can't reproduce it using this code:

export const fetchPageConfig = (pageId, pageLink) => dispatch => {
    return myFetch(
      `${API.apiPrefix}page/config/\${pageId}/1\${pageLink === "preview" ? "?preview=true" : ""}`,
      {
        method: "POST",
        isQuiet: true,
        isLoading: true,
      }
    );
  };

Can you share a file which triggers the error (a file, not an image please).

@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Feb 11, 2019

Hi @xiezhongfu! A maintainer of the project has notified me that you're missing
some information we'll need to replicate this issue.

Please understand that we receive a high volume of issues, and there are only a limited number
of volunteers that help maintain this project. The easier it is for us to decipher an issue with the info provided,
the more likely it is that we'll be able to help.

Please make sure you have the following information documented in this ticket:

  1. Your Babel configuration (typically in the form of a .babelrc)
  2. The current (incorrect) behavior you're seeing
  3. The behavior you expect
  4. A short, self-contained example

Please provide either a link to the problem via the repl, or if the repl is insufficient,
a new and minimal repository with instructions on how to build/replicate the issue.

@danez danez removed their assignment Feb 13, 2019

@danez danez closed this Feb 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment