“Unexpected token: punc ())” when building for production

后端 未结 4 1655
再見小時候
再見小時候 2020-12-29 06:14

If I try to test-build my application with ng build --prod --aot I get the following, quite short, error message:

$ ng build --prod
                      


        
4条回答
  •  醉酒成梦
    2020-12-29 07:21

    After upgrading to angular 8 during production build, I was getting "Error in common-es2015.xxx.js from Terser Unexpected token: Punc(;) [common-es2015.xxx.js] "

    After setting sourceMap to true in angular.json file - configurations- production section, compiler displayed actual file name with error line number. It was due to an extra semicolon in a variable declaration in the class file.

    putGamma: any = 0.0;; 
    

提交回复
热议问题