When deploying my Rails app I get the following error:
rake aborted!
ExecJS::ProgramError: Unexpected token punc «(», expected punc «:» (line: 15, col: 14
As the backtrace doesn't provide information about the corrupted file, for me the best way to identify the error is use git bisect.
It allows you to find the commit that introduces a bug.
Let's suppose you are on master, first you start git bisect:
$ git bisect start
$ git bisect bad
Then you go back to a previous, working revision, let's suppose 20 revision ago.
$ git checkout HEAD~20
You run the same command
$ RAILS_ENV=production rake assets:precompile
If it works you mark revision as good:
$ git bisect good.
git will jump to another revision, you run same command again (assets:precompile) and bassed on the output mark it as good / bad.
In less than 1 minute you should be able to find what's the commit that introduced the issue.