ccxt: React + create-react-app: Failed to minify error
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (10 by maintainers)
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
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:
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
@sib-wolf Seems that
create-react-appdoesn’t provide any mechanism to override it’s Webpack config except by running thenpm run ejectcommand (see the link provided).Then you can edit the
config/webpack.config.prod.jsfile, adding this code after the line 155:I understand that it looks very hack-ish, and probably isn’t the way the problem should be solved at all. We will consider to start distributing a pre-transpiled version of CCXT instead, but in the meantime, you can try this hack.
hi, I tried both @xpl hack and also following what they recommended with issue 225 but still running into the same issue. Any ideas?