Debug: Unable to build in React: Failed to Minify

Created on 25 Oct 2018  路  6Comments  路  Source: visionmedia/debug

I'm unable to build my React project. Getting a failed to minify the code error.

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

        ./node_modules/debug/src/browser.js:155

Read more here: http://bit.ly/2tRViJ9

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
awaiting-response

Most helpful comment

@Qix- also ran into this issue, basically older versions of react-scripts, a dependency of create-react-app, don't support ES6 when minifying and can confirm that using debug@3 works in this scenario. For anyone else the latest versions of v1.x and v2.x branches of create-react-app work with ES6 dependencies out of the box.

All 6 comments

What is the reason? Any other errors?

I'm not sure what you mean. Why is the minifier failing? There is no error message there except that the minifier failed.

There's nothing I can do without an error message.

I have tested by creating a default CRA app, installed this module (4.1.0), used it in the code and ran build command and everything seems to be working fine. The build package generated successfully.
If you haven't changed the file (browser.js), try cleaning the node_modules folder and install again.

That doesn't fix the issue. ../dist/ isn't supported and will probably get removed. Don't do that.

You have not given me an error message, but this doesn't sound like debug's problem. It really sounds like your minifier doesn't support ES6. Does downgrading to debug@3 fix your issue?

@Qix- also ran into this issue, basically older versions of react-scripts, a dependency of create-react-app, don't support ES6 when minifying and can confirm that using debug@3 works in this scenario. For anyone else the latest versions of v1.x and v2.x branches of create-react-app work with ES6 dependencies out of the box.

Thanks for the update @roryrjb :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

krismeister picture krismeister  路  6Comments

ArvoGuo picture ArvoGuo  路  5Comments

pavanjadhaw picture pavanjadhaw  路  5Comments

Qix- picture Qix-  路  7Comments

roccomuso picture roccomuso  路  8Comments