Skip to content

ng build --prod UglifyJs failure #6863

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

Closed
joaogarin opened this issue Jul 2, 2017 · 5 comments
Closed

ng build --prod UglifyJs failure #6863

joaogarin opened this issue Jul 2, 2017 · 5 comments

Comments

@joaogarin
Copy link

  • [ X] bug report

Versions.

@angular/cli: 1.1.1
node: 6.9.3
os: darwin x64
@angular/animations: 4.2.2
@angular/common: 4.2.2
@angular/compiler: 4.2.2
@angular/core: 4.2.2
@angular/forms: 4.2.2
@angular/http: 4.2.2
@angular/material: 2.0.0-beta.6
@angular/platform-browser: 4.2.2
@angular/platform-browser-dynamic: 4.2.2
@angular/router: 4.2.2
@angular/cli: 1.1.1
@angular/compiler-cli: 4.2.2
@angular/language-service: 4.2.2

Repro steps.

Use a package that contains default parameters

The log given by the failure.

ERROR in vendor.d600eae1111f8d3f3292.bundle.js from UglifyJs
Unexpected token operator «=», expected punc «,» [/Library/WebServer/Documents/contenta/contenta_angular/~/d8-
jsonapi-querystring/index.js:39,0][vendor.d600eae1111f8d3f3292.bundle.js:28577,47]

Desired functionality.

Not break.

Mention any other details that might be useful.

the issue is related to #5741. I am using a package that exposes es6 and potentially some es7 code, including default parameters.

Cli seems to use UglifyJs without passing it to es5 is that possible? Why does it break on code using default parameters, that is my main question. And what can be done inside the cli (or in my project, or even in the npm package) to go around it.

Thanks for the info

@leocaseiro
Copy link

Perhaps if we use uglify-es?

@joaogarin
Copy link
Author

Yeah this was an issue on the package. as it was not being properly transpiled before npm publish.talked to the author, the package now properly transpiles default parameters and all works fine.

@alirezamirian
Copy link
Contributor

I'm also getting

ERROR in main.d6c91c76952d3513d43f.bundle.js from UglifyJs
Unexpected token: name (i) [main.d6c91c76952d3513d43f.bundle.js:232,8]

It seems dependency to UglifyJs is only via html-webpack-plugin:

@ghost
Copy link

ghost commented Sep 4, 2017

Same here..

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants