You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating to v4 (which worked fine in dev mode) production build fails:
alexa@DESKTOP-6C4V66Q C:\Users\alexa\ae2
> yarn build
yarn run v1.3.2
$ react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/json2csv/lib/JSON2CSVBase.js:9
Read more here: http://bit.ly/2tRViJ9
So the reason for my (and likely lots of other people's) build breaking is that json2csv does not compile to es5.
I do realize that it is nice to code using es6 - I do it myself. But can you please compile it to es5 as long as this prevents usage in most browser use cases?
The text was updated successfully, but these errors were encountered:
The issue is not that the code is bundled using webpack. The issue is that the code is using es6. And that create-react-app uglifies all imported code. And that this only works with es5 code, causing above error if the code is es6.
The issue is also that older browsers will fail to understand es6 code. That is the reason why create-react-app expects libraries to use es5.
It should not be too hard to compile this library es6 code back to es5 as you seem to be using webpack.
Uh oh!
There was an error while loading. Please reload this page.
I am using create-react-app (https://github.com/facebook/create-react-app).
After updating to v4 (which worked fine in dev mode) production build fails:
create-react-app explains the issue here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify
It seems like the breaking part is uglify, see here: facebook/create-react-app#984 (comment)
So the reason for my (and likely lots of other people's) build breaking is that json2csv does not compile to es5.
I do realize that it is nice to code using es6 - I do it myself. But can you please compile it to es5 as long as this prevents usage in most browser use cases?
The text was updated successfully, but these errors were encountered: