-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ES6] destructuring regression in collapse_vars
: ERROR: sym.definition is not a function
#2896
Comments
This breaks https://github.com/webpack-contrib/uglifyjs-webpack-plugin I had to manually revert the packages dependencies to v3.3.4 to be able to build the project again. |
I reverted the version to v3.3.9 and it works well. |
Getting this with a file that just uses arrow functions -- no other es6 syntax. Correction -- changed input to be es5 syntax (var statements, no arrow functions, etc) -- it's still giving this error. |
When to bump version code? |
@alexlamsl could you please release a new version? A lot of webpack based projects are experiencing failed builds because of this :( |
Please, release a new version :( |
For those finding their way here from Google, this appears to be a suitable workaround for your package.json "uglify-es": "3.3.9",
"uglifyjs-webpack-plugin": "1.1.8", EDIT this appears to not work for everyone. Sorry! Needless to say the only chance this will have of working will be if you clear node_modules and then re-run |
@arackaf those versions do not fix my error... |
@chenyong - did you clear your node_modules and then re-install? |
Just noting the affects parcel too, not just webpack. |
I also getting an error while creating bundle.js through webpack using this plugin. |
@arackaf's solution worked for me only after removing |
Just to clarify, it won't work for anyone without clearing node_modules and re-installing. |
it seems like this is fixed only now if you use
|
Please fix it in main branch so everyone can use it. |
Any ETA on v3.3.11? |
I found something interesting regarding this. This issue only seem to exist when installing via Yarn. Whenever I use NPM instead of Yarn it seems to work as expected. I have been switching between them for the sake of testing it and it seems pretty consistent. As if NPM installs differently than Yarn or something? If you really need a fix now, switching to |
@johman10 That's because the npm version has been reverted to 3.3.9 |
PR #9652 by @klaussner upgraded `uglify-es` from 3.2.2 to 3.3.10 to fix issue #9647, but 3.3.9 is the latest version published to npm, and 3.3.10 seems to suffer from this bug: mishoo/UglifyJS#2896 For that reason, I think it might be best to downgrade `uglify-es` to 3.3.9, at least until 3.3.11 is published. Since this bug causes `uglify-es` to throw during minification, the `meteorJsMinify` function falls back to Babel's minifier, which is known to use massive amounts of memory, and may be contributing to OOM problems such as #9568. In other words, there's a chance that this downgrade will help with #9568.
* Downgrade uglify-es from 3.3.10 to 3.3.9 (latest published). PR #9652 by @klaussner upgraded `uglify-es` from 3.2.2 to 3.3.10 to fix issue #9647, but 3.3.9 is the latest version published to npm, and 3.3.10 seems to suffer from this bug: mishoo/UglifyJS#2896 For that reason, I think it might be best to downgrade `uglify-es` to 3.3.9, at least until 3.3.11 is published. Since this bug causes `uglify-es` to throw during minification, the `meteorJsMinify` function falls back to Babel's minifier, which is known to use massive amounts of memory, and may be contributing to OOM problems such as #9568. In other words, there's a chance that this downgrade will help with #9568. * Also bump standard-minifier-js package version.
v3.3.10 breaks support for destructured assignments, ref: mishoo/UglifyJS#2896. Downgrading to 3.3.9 fixes the issue.
@mishoo Is there any way to install the package through yarn? |
As a more permanent fix, you might want to try: |
Solution for Yarn, add following in your
It will make sure any package depending on uglify-es will resolve to 3.3.9 ( https://yarnpkg.com/lang/en/docs/selective-version-resolutions/) |
@pbadenski's solution of using resolutions did not work for me. Installing with NPM instead of Yarn did however. |
Bug report or feature request?
bug
ES5 or ES6+ input?
ES6
Uglify version (
uglifyjs -V
)uglify-es 3.3.10
JavaScript input
caught by harmony "npm test" reminify:
The text was updated successfully, but these errors were encountered: