New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React + create-react-app: Failed to minify error #299
Comments
Hi, @sib-wolf! Thanks for reporting this! What's your version of Node? |
What framework are you using? This is related to a minifier (probably, UglifyJS) that cannot understand ES6 code + your framework excludes |
Hello! Thank you for the quick response. I'm using create-react-app and am running node v8.6.0. Webpack and babel are already pre-packaged with create-react-app. In their documentation it says:
I can try converting to a custom setup, but I don't think node_modules is being excluded. Have many other packages being pulled from that directory that are working. |
@sib-wolf Can you please upload somewhere a minimal project that demonstrates the error? A GitHub repo would be fine. |
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 |
@sib-wolf Seems that Then you can edit the {
test: require.resolve('ccxt'),
loader: require.resolve('babel-loader'),
options: { compact: true },
}, 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. |
@sib-wolf does the above answer from @xpl solve this issue for you? I'd close this issue if it does, and if not, let us know. In the meantime we will restore the ES5-version of the library. We actually had it previously, but we thought it's not worth maintaining and removed it... Anyway, we'll do ccxt in ES5 again to avoid those problems in future, hope to upload soon. |
Sorry, didn't have a chance to test it until now. Made a copy of the working directory, ran npm eject in it, and do not have that issue anymore. Thank you both for your help! I'll be on the lookout for the version that comes out which doesn't require the "npm eject". |
@sib-wolf do you mind if I close it for now? We will keep you updated on ES5 anyways. Feel free to reopen it or ask your questions, if any. Thx! |
nope, please do. thank you! |
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 |
@trm313 thx for reporting and for making the reason even more clear. We're still in doubt whether we should restore the ES5-version, or should we just wait for the migration to complete... 98% of browsers support ES6 by now, so we expect all those frameworks to obtain support for new syntax features as well. You see, the longer we support for outdated ES5-frameworks, the longer they remain outdated. We will reconsider this again in shortest time possible. Thx again! |
@kroitor any updates regarding the decision of distributing a pre-transpiled version? I am having the need to use babel just for transpiling the code both to node 6.x and to ES5 in different projects. |
@lpfeup did you try this suggestion by @xpl: #299 (comment) ? |
@kroitor perhaps I should have asked this in another thread, since my issue is not directly related to this one. I need an ES5 version of this lib, which I am currently transpiling using babel. Just wanted to know if you were still considering distributing one. Thanks |
@lpfeup it isn't our topmost priority now, yet we still hope to do it asap. We are thankful for all contributions, your pull requests are welcome! |
I'm working on a React app. When running "npm run build" I receive the error below. Any help would be appreciated!
The text was updated successfully, but these errors were encountered: