ERROR in Invalid or unexpected token on Angular production build

家住魔仙堡 提交于 2021-02-10 21:42:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!