adamhalasz/uniqid

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

djErock opened this issue · 5 comments

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..

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

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

Awem commented

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 commented

Same as #22

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