问题
chunk {0} runtime.06daa30a2963fa413676.js, runtime.06daa30a2963fa413676.js.map (runtime) 1.5 kB [entry] [rendered]
chunk {1} main.9868d9b237c3a48c54da.js, main.9868d9b237c3a48c54da.js.map (main) 182 bytes [initial] [rendered]
chunk {2} polyfills.85f47f0bf59079cbc23a.js, polyfills.85f47f0bf59079cbc23a.js.map (polyfills) 189 bytes [initial] [rendered]
chunk {3} styles.da6a8dc1b4027cfd731e.css, styles.da6a8dc1b4027cfd731e.css.map (styles) 338 kB [initial] [rendered]
ERROR in Invalid or unexpected token
I'm receiving the above error message on
ng build --prod
On other machines, the build works. Also, the debug build (ng serve) works as well. The error message provides no clue on where to start searching. What is the cause for this error and/or how can it be identified?
Here is some verion information:
Angular CLI: 6.0.8
Node: 6.8.0
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
回答1:
The problem was solved updating to the current version of node.js.
回答2:
Checks your angular.json file. It might be difference between production and debug configurations.
来源:https://stackoverflow.com/questions/55022061/error-in-invalid-or-unexpected-token-on-angular-production-build