-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
npm run build: fails in node_module on "class" or prototype defination #3047
Comments
Looks like the package is intended to be used in Node, not on the web. |
This is an opinion.. |
That may be so, so I'm sorry that Create React App doesn't work for your use case. Feel free to eject if the above options do not work for you. |
You can follow #2108 which would allow using |
We’ll eventually switch to Uglify v3 that allows it. |
It is easy for me to avoid prototype and class in the future. It is just confusing, I don't really have the best javascript history knowledge yet. And it was a little strange to see prototype working the the browser but be unable to package it. Thanks for the feedback.. Probably a good plan to upgrade eventually.. |
Uglify v3 would be much better .. Look like it can't handle default parameter values either. |
The problem here is that you will ship code in production that will bomb out for users without browser support. |
When we switch to Uglify v3, we're going to need to also make sure syntax is parsed strict with the browsers you've specified to target, that way you don't accidentally ship bad syntax and break parsing on older browsers. |
I understand.. We are developing blockchain apps that make use of |
Ah, that's exactly what #892 will be! 😄 Thanks for the context. For instance, you'll be able to target like: "browsers": {
"development": [
"last 1 chrome version"
],
"production": [
"last 4 versions",
"not ie < 11"
]
} These wouldn't be runtime-enforced, however -- you'd need to do that yourself. Or maybe we could add an optional splash. 🤔 |
Your concern is about the build output code version. But this issue is about the version of the dependent modules going into the build.. These should be two different things. How about run the babel es2015 conversion before Uglify v2? This is the code I used in my module to make it comparable with create-react-app. If create-react-app did this then many other modules would be spared from having to generate and deploy the generated copy to npm (which is a challenge to keep in sync).I think this is reasonable since old browsers do not run code directly from npm, they always go though a build process. The trick is to create the more compatible generated code as late as possible.
"babel": {
"presets": [
"es2015"
]
} |
@jcalfee ah, that's where our misunderstanding is! We do not compile any code from We do not compile |
Is this a bug report?
Not sure
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
deploy
configure
Environment
node -v
: v8.2.1npm -v
: 5.3.0yarn --version
(if you use Yarn):npm ls react-scripts
(if you haven’t ejected): react-scripts@1.0.12Then, specify:
Steps to Reproduce
(Write your steps here:)
Expected Behavior
success
Actual Behavior
Line 25 is either "class" in or in my local testing the first nonoccurence of "PublicKey.prototype.xxx ="
Reproducible Demo
none yet
Prototype and classes are pretty standard I'm not sure why this would fail..
The text was updated successfully, but these errors were encountered: