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

It all started with this warning:

enter image description here

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

Leave a Comment