Skip to content
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

Failed to minify code from this file ./node_modules/d3-array/src/rollup.js:3 #80

Closed
agupta93 opened this issue Nov 10, 2018 · 10 comments
Closed

Comments

@agupta93
Copy link

While building with create-react-app getting the above error after the latest release

@agupta93
Copy link
Author

Can someone please check it is getting a blocker for our release

@lucidfrontier45
Copy link

Looks like this commit caused the problem.
729367e#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R24

Webpack is trying to include rollup.js which contains ES6 expression and cannot be uglified.
Below is my error log

static/js/main.e63b9209.js from UglifyJs
Unexpected token: name (index) [./~/d3-array/src/rollup.js:3,0][static/js/main.e63b9209.js:47905,6]

@curran
Copy link

curran commented Nov 10, 2018

Can one of you provide a way to replicate the behavior? Ideally a complete repo where someone could clone it and run npm start or something in order to see the error. Thanks!

Also, what is the expected behavior? Uglify does not support ES6, which is not a problem with D3.

@lucidfrontier45
Copy link

I found the error only occurs with react-scripts v1.x and the error disappeared after upgrading to v2.

@lucidfrontier45
Copy link

lucidfrontier45 commented Nov 10, 2018

@curran The expected behavior is successful build with creat-react-app project. However as it is already resolved in the latest react-scripts v2, I think this issue can be closed.

@agupta93
Copy link
Author

The issue mentioned here is in the rollup file. It is written in ES6 so when create react app tries to minify the same it starts breaking. The issue might not be present in react-scripts v2 but forcing people to upgrade to that makes it a breaking change which should be a major version update and not a minor version update

@mbostock
Copy link
Member

Yes, I’m starting to adopt more recent ES features in D3 modules. I’m going to do a major version bump when I rewrite the array methods to allow iterables rather than just arrays, but the addition of d3.group and d3.rollup was backwards-compatible and thus only saw a minor version bump.

@agupta93
Copy link
Author

@mbostock It is not currently backward compatible as we get this error while trying to build via react-scripts 1.x.x. Forcing an upgrade would not be a good solution

@mbostock
Copy link
Member

The definition of backwards-compatible is subjective; see Why Semantic Versioning Isn’t for context. At any rate, since I’m planning on following this up with a major version bump to switch to iterables, I’m happy to defer the addition of group and rollup to d3-array@2 (d3@6) and consequently have unpublished 1.3.0.

@agupta93
Copy link
Author

agupta93 commented Nov 10, 2018

@mbostock If that could happen it would be really very helpful. Would save us a lot of trouble in our application :) Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants