-
Notifications
You must be signed in to change notification settings - Fork 12k
UglifyJs Unexpected token: name (Time) #6655
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
@AKuzmanoski Are you getting any errors while running the dev build? |
No, it works fine on dev mode |
I've started hitting this -
import { TaskTableComponent } from './task-table/task-table.component';
|
Can you share some details abot TaskTableComponent? |
I may have found the problem - I had a target of es6, because es5 was causing me problems with I think that es6 does not compile properly with uglify.js , which may be throwing out the errors Any idea on how I can get uglify to work with es6 ? |
I've resolved this using UglifyJS2#harmony-v2.8.22 --dev for ES6: yarn add git://github.com/mishoo/UglifyJS2#harmony-v2.8.22 --dev documented at: https://www.npmjs.com/package/uglifyjs-webpack-plugin |
I changed compilerOptions.target from es6 to es5 and this error disappeared. |
I have compilerOptions.target of es5 and still have ERROR from UglifyJS. I figured it's because I'm using |
I have the same issue, with a library required by AutobahnJS called cbor. There I get this error when trying to build with
Anyone have a solution? |
Same problem for me with quilljs when i try to create a custom theme based on snow theme, when i run "ng build --prod" :
Please give us a solution/workaround |
I think all these issues are supposed to be gathered in #2907 |
I can confirm this issue. Only happens when I set the target to |
I changed compilerOptions.target from es6 to es5 and OK too. |
I as well can confirm that you can't switch back the target to es5 if you have package like SignalR core which propably uses es6. |
Upgrade to a newer version of angular-cli, this has been fixed for a little while now: #7610 |
cli update because of bug: angular/angular-cli#6655
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. |
Bug Report or Feature Request (mark with an
x
)Building production using
ng build --prod
results with the following error:ERROR in vendor.6524f61fda4d53a6f933.bundle.js from UglifyJs Unexpected token: name (Time) [vendor.6524f61fda4d53a6f933.bundle.js:18068,6]
I can't find Time in my project path, i think it is from some of the libraries i use.
Before i updated Angular, and Angular CLI
I used Angular 4.1.3 and Angular CLI 1.0.6 and I was getting similar error but insted of Time, unexpected token was PolicyMappings which was from pkijs
I also found Time class in pkijs
Versions.
@angular/cli: 1.1.1
node: 7.5.0
os: win32 x64
@angular/animations: 4.2.1
@angular/common: 4.2.1
@angular/compiler: 4.2.1
@angular/core: 4.2.1
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.2.1
@angular/http: 4.2.1
@angular/material: 2.0.0-beta.6-88089a7
@angular/platform-browser: 4.2.1
@angular/platform-browser-dynamic: 4.2.1
@angular/router: 4.2.1
@angular/cli: 1.1.1
@angular/compiler-cli: 4.2.1
@ngtools/webpack: 1.4.1
Repro steps.
npm install pkijs
npm install @types/pkijs
ng build --prod
The text was updated successfully, but these errors were encountered: