-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
CRA 2 browserslist build can generate invalid code #4665
Labels
Milestone
Comments
/cc @existentialism |
Enabling |
Before Uglify:
After:
|
I tried out terser and it seem to work better. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
I created a minimal repro using CRA2
"react-scripts": "2.0.0-next.3e165448"
Which terms did you search for in User Guide?
browserslist
,bad build
,yarn build
Environment
Steps to Reproduce
Clone https://github.com/jazeee/cra-build-bug-demo
Repro in Demo app:
yarn start
Works
.yarn build
Observe an alert saying
TypeError: Assignment to constant variable.
Expected Behavior
Expect
Works
Also, can see the compiled code has a problem:
For reference, can make the minified code beautiful using:
yarn build && js-beautify build/static/js/main.*.js
Actual Behavior
Observe an alert saying
TypeError: Assignment to constant variable.
Reproducible Demo
Clone https://github.com/jazeee/cra-build-bug-demo
Works when using:
In
package.json
:Since this is using a "bleeding edge" build (last 1 browser version), feel free to consider this as minor. It probably is an issue, but it can wait...
Thanks much.
The text was updated successfully, but these errors were encountered: