angular-cli: Error during prod build in Angular Cli

Bug Report or Feature Request (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Repro steps.

The log given by the failure.

94% asset optimization(node:11160) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token: operator (>) (node:11160) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Desired functionality.

Mention any other details that might be useful.

I can do normal build only build in prod fails with above error. greatly appreciate help here. While I have read the Promise Then and Catch - I have followed the pattern in my source code every where but exact issue is missing and I cant really build anymore.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 11
  • Comments: 22 (2 by maintainers)

Most upvoted comments

I got this error when I included a script file inside the angular-cli.json written in es6. I converted it to es5 by change ‘let’ back to ‘var’ and removing arrow functions.

@thekhoi

I got this error when I included a script file inside the angular-cli.json written in es6. I converted it to es5 by change ‘let’ back to ‘var’ and removing arrow functions.

Thanks, it restore production build for me

Same here with @angular/cli@1.4.2

94% asset optimization(node:20368) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token: name (f)

I have the same issue. I’m not using Bootstrap nor popper.js. As this issue post has been closed, I suppose this has been fixed. But where and how? My “target” is “es5” while my “lib” is “es2017”. Could this be the issue? Changing es5 to es2017 yields the same result. Any help or fix?

Same here. I also use Bootstrap 4 and Pooper.js.

@angular/cli: 1.4.3 node: 7.5.0 os: win32 x64 @angular/animations: 4.3.2 @angular/common: 4.3.2 @angular/compiler: 4.3.2 @angular/compiler-cli: 4.3.2 @angular/core: 4.3.2 @angular/forms: 4.3.2 @angular/http: 4.3.2 @angular/platform-browser: 4.3.2 @angular/platform-browser-dynamic: 4.3.2 @angular/platform-server: 4.3.2 @angular/router: 4.3.2 @angular/cli: 1.4.3 typescript: 2.3.4

.angular-cli.json

...
"scripts": [
    "../node_modules/popper.js/dist/umd/popper.min.js",
    "../node_modules/bootstrap/dist/js/bootstrap.min.js",
  ],
...

Yes, one thing is confirmed, this is due to external scripts. I am using bootstrap 4 in my project and it has a dependency on popper.min.js and it is based on es6. I changed my “target”: “es2016”, in my tsconfig file and it’s working now besides a few warnings, still figuring out how to get rid of them.