question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 4, Unexpected token: name (Subject) during ng build --prod

See original GitHub issue

Bug Report or Feature Request (mark with an x)

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

I have a Angular 4 application.

I can successfully build the project with ng build

But, when I run ng build --prod error is thrown.

When I did some research, I saw uglifyjs not working with es6 and I changed target to es5 in my tsconfig file.

But I keep getting this error.

I don’t understand what is wrong.

Versions.

7eili 1

Repro steps.

  1. Run this command: ng build --prod

The log given by the failure.

ERROR in vendor.4008cf7dff2b98412878.bundle.js from UglifyJs Unexpected token: name (Subject) [vendor.4008cf7dff2b98412878.bundle.js:19471,6]

Desired functionality.

The build should finish without an error

Mention any other details that might be useful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
oguzkurtcuoglucommented, Oct 13, 2017

Thank you again 😃 Now, I will close issue. My problem is solved.

1reaction
hiepxanhcommented, Oct 13, 2017

first

ng build --prod --sm

to detect the error second check the 3th libs causing problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4, Unexpected token: name (Subject) during ng build
Run ng build --prod --sourcemaps to identify the package causing the problem. Then you need to find a workaround. That's the challenge...
Read more >
angular/angular-cli - Gitter
Hey everyone. I just started experiencing a very weird issue when trying to build my angular app. I get the error "An unhandled...
Read more >
ng build - Angular
Option Description Value Type Default Value ‑‑aot Build using Ahead of Time compilation. boolean true ‑‑base‑href Base url for the application being built. string ‑‑delete‑output‑path Delete...
Read more >
Angular Archive - TechOverflow
woff2 in the dist folder when building for production using ng build . These hashes have the purpose of preventing the files from...
Read more >
The Complete Guide to Angular User Authentication with Auth0
Get the Starter Application. Look for the 🛠️️ emoji if you'd like to skim through the content while focusing on the build steps....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found