-
Notifications
You must be signed in to change notification settings - Fork 12k
AOT Error: UglifyJs TypeError: str.replace is not a function at make_string #9218
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
Comments
Same issue breaks when compiling --prod due to Uglify Output from:
Observed behavior
|
Same for my project, building with Angular CLI 1.6.4:
Clearing the npm cache and removing the node_modules folder did not help. |
there seems to be something broken, in some npm modules. When I build the project on a other pc its working, because I've old node modules folder there. But with a new node_modules folder its not working anymore. Someone has broken its dependencies |
I've the same problem. This is critical issue because I am not able to create new prod build.
|
This is an uglify-es bug. |
We have the same problem. However we now enforce following packages to make the build work again:
It seems the new release of uglify-es (3.3.7) done last weekend is creating the issue. I hope this helps somebody in getting his production build running again. |
Thank you for research, @rbluethl and @rdnscr! Your solution resolves the issue. While the issue exists in Angular CLI dependencies, just add {
...
"devDependencies": {
"@angular/cli": "1.6.5",
...
"uglify-es": "3.3.5"
}
} Please, pay attention that you may need to run |
This bug is probably not related to mishoo/UglifyJS#2783. If someone is able to isolate this " The |
Uglify fix: mishoo/UglifyJS#2810 |
@filipesilva @clydin It would be very helpful if a new flag were added to angular-cli to disable uglify in webpack:
That way users could upload the problematic unminified webpack bundle file(s) into a bug report for simple diagnosis. |
rdnscr solution fix the build error, but some functionality in my app was broken on production built. upgrading uglify to 3.3.8 seems to have fix the issue.
|
The issue was resolved in uglify-es 3.3.8.
|
I understand this has been fixed in uglify 3.3.8. I cannot get my project to update it. I have removed the lock file, cleared the cache via --force and did an install. I added 3.3.8 as a devdependency per the above comment. I end up with references to both versions in my lock file. I noticed uglifjs-webpack-plugin 1.1.6 has 3.3.7 listed as a dependency. In turn, the cli references the plugin. How do I get it to pick up 3.3.8? Thanks I'm still learning my way around npm. I added my package.json file. |
@filipesilva made a write up how to do this for an earlier version: #8571 (comment) |
Closing as resolved by |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
The text was updated successfully, but these errors were encountered: