If I try to test-build my application with ng build --prod --aot
I get the following, quite short, error message:
$ ng build --prod
It all started with this warning:
It was this missing comma, which I put there to silence the warning, which rendered my project uncompileable.
I was only able to locate this issue by using --source-map
but also setting --build-optimizer=false
ng build --prod --named-chunks --verbose --build-optimizer=false --source-map
I had the same problem and found out it was caused by https://www.npmjs.com/package/url-parameter-append
There was an extra comma after a list of parameters in a function call
I removed the comma in my own copy of url-parameter-append.js and then it worked.
I reported the bug to the author of that package https://github.com/techinity/url-parameter-append/issues/10 , but really IMO the bug is
In my case it was a leftover comma at the end of a list of functions inside a custom .js file in \src
directory.
The tip of by --source-map=true
and also setting --build-optimizer=false
in angular.json
helped me a lot.
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;;