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

Numeric Separators not supported if used with React #922

Open
clickwithclark opened this issue Nov 19, 2021 · 1 comment
Open

Numeric Separators not supported if used with React #922

clickwithclark opened this issue Nov 19, 2021 · 1 comment

Comments

@clickwithclark
Copy link

I'm submitting a bug report

Webpack Version:
4.44.2

Babel Core Version:
"7.16.0",

Babel Loader Version:
5.4.x/6.2.x

Please tell us about your environment:
Windows 10

Current behaviour:
Numeric Separators not working with React
It detects underscores as an identifier

Expected/desired behaviour:
10_000 should be seen as 10000
instead is seen as 10 and _000

Uncertain of how to get the configuration,
Building a module works fine on its own with webpack.
but using the module in a React Application throws a failed to compile error

for example : One of the functions in my module is written as :

export function waitForElement(
  selector,
  checkFrequencyInMs = 500,
  timeoutInMs = 10_000
......
) {

When I try to use it in a React App :
image

Sorry if the information is not sufficient. If it needs to be placed somewhere else instead please let me know.

Everything works when I removed the underscore.

@JLHwung
Copy link
Contributor

JLHwung commented Nov 20, 2021

The error is thrown from acorn because webpack 4 does not support ES2021. You can upgrade to webpack 5.

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

2 participants