question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React + create-react-app: Failed to minify error

See original GitHub issue

I’m working on a React app. When running “npm run build” I receive the error below. Any help would be appreciated!

Failed to minify the code from this file:
 	./node_modules/ccxt/ccxt.js:51
Read more here: http://bit.ly/2tRViJ9

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
sib-wolfcommented, Oct 10, 2017

Created a fresh install of “create-react-app” and ran the command “npm install ccxt --save”. Was able to reproduce the issue, same minify error occurs.

Repo with minimal project - https://github.com/sib-wolf/ccxt-test

2reactions
trm313commented, Oct 24, 2017

Hello - I wanted to add some additional information to this issue, since I’m experiencing it as well, but have a few extra observations.

Create-react-app build script fails with error:

Failed to compile.

static/js/main.495d93a9.js from UglifyJs Unexpected token: name (BaseError) […/~/ccxt/ccxt.js:51,0][static/js/main.495d93a9.js:53892,6]

What’s interesting, however, is that it didn’t fail before. When I first installed the ccxt package (“ccxt”: “^1.9.154”) it was building fine, I even deployed it to heroku, and it’s still live here: https://crypto-bot-trm313.herokuapp.com/ (git repo https://github.com/trm313/crypto-bot)

Yesterday, I tried to push some new changes which was when I experienced the build error for the first time. At this point, I had not modified the ccxt release I was using, although I did add some extra code with it in my app (specifically an API route that accessed the fetchTickers() function)

I tried updating to the latest release (1.9.250), but the error remains.

From the research I’ve done, I think you’re correct that CRA can’t handle any ES6 code, and as you pointed out, I’m sure ejecting the app would work as well, but obviously that’s not ideal, so wanted to share the other info I had in case it points to an easier fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Failed to minify the bundle" error on build (related to Terser)
yarn build works for me right after npx create-react-app , but fails if I delete yarn.lock and node_modules , and reinstall the modules...
Read more >
Failed to minify the code from this file - Stack Overflow
npm run build fails to minify Before react-scripts@2.0.0 , this problem was caused by third party node_modules using modern JavaScript ...
Read more >
Resolving "Failed to minify the bundle" Errors - CircleCI Support
TerserWebpackPlugin The following error message is usually related to running out of memory during a job: Failed to minify the bundle....
Read more >
Optimizing Performance - React
If you're benchmarking or experiencing performance problems in your React apps, make sure you're testing with the minified production build.
Read more >
[Solved]-Failed to minify the bundle. Error - appsloveworld.com
Failed to minify the bundle. · Exclude JSON files from the main bundle with webpack for react-lottie · How do I resolve the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found