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

Failed to minify the code from this file: node_modules/uniqid/index.js:18 #34

Open
djErock opened this issue Jan 13, 2020 · 5 comments
Open

Comments

@djErock
Copy link

djErock commented Jan 13, 2020

I ran "npm audit fix" and it upgraded uniqid to 5.2.0 but when i attempt to run a build it breaks with:

Failed to minify the code from this file: node_modules/uniqid/index.js:18

I downgraded uniqid package to 5.0.3 and the error went away.

The error is so cryptic I couldn't even track down the line. The line 18 above is just a for in loop.

BTW... I am not using react-scripts and ejected long ago..

@djErock
Copy link
Author

djErock commented Jan 13, 2020

I ran "npm audit fix" and it upgraded uniqid to 5.2.0 but when i attempt to run a build it breaks with:

Failed to minify the code from this file: node_modules/uniqid/index.js:18

I downgraded uniqid package to 5.0.3 and the error went away.

The error is so cryptic I couldn't even track down the line. The line 18 above is just a for in loop.

BTW... I am not using react-scripts and ejected long ago..

Had this crop up in the past with import statements --> reference here: https://stackoverflow.com/questions/45671597/failed-to-minify-the-code-from-this-file

@Ashish1857
Copy link

It is still showing same error? any fix/idea ?

@Awem
Copy link

Awem commented May 14, 2020

The problem is caused by using ES6 code in index.js (let, constetc.). If the tool your are using for uglification does not support ES6 code, it will fail. You could use an uglifyer that supports it (e.g. Terser), but the proper fix would be to ensure ES5 compatibility of indes.js because it is a distributed file.

@Awem
Copy link

Awem commented May 14, 2020

Same as #22

@mrwadepro
Copy link

I'm having the same issue, react-scripts is updated to the latest version as well.

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

4 participants