Skip to content

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

@oguzkurtcuoglu

Description

@oguzkurtcuoglu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions