When deploying my Rails app I get the following error:
rake aborted!
ExecJS::ProgramError: Unexpected token punc «(», expected punc «:» (line: 15, col: 14
December/2019 answer: starting on version 4.2.0 (released in Sept/2019), Uglifier now shows a beautiful (colored!) debug output showing you the offending line of code.
I was having a Uglifier::Error: Unexpected character '
'` error and I couldn't find it even following all the other solutions in this page.
So go to your Gemfile, and set your Uglifier to be at least 4.2:
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 4.2'
Run bundle update uglifier
to update it.
And then just look at the output, it will show you something like this: