uniqid icon indicating copy to clipboard operation
uniqid copied to clipboard

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

Open djErock opened this issue 5 years ago • 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..

djErock avatar Jan 13 '20 15:01 djErock

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

djErock avatar Jan 13 '20 15:01 djErock

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

Ashish1857 avatar Apr 15 '20 20:04 Ashish1857

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 avatar May 14 '20 09:05 Awem

Same as https://github.com/adamhalasz/uniqid/issues/22

Awem avatar May 14 '20 09:05 Awem

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

mrwadepro avatar Jun 24 '20 04:06 mrwadepro