ExecJS::ProgramError: Unexpected token punc «(», expected punc «:» when running rake assets:precompile on production

后端 未结 10 1408
小鲜肉
小鲜肉 2020-11-28 20:08

When deploying my Rails app I get the following error:

rake aborted!
   ExecJS::ProgramError: Unexpected token punc «(», expected punc «:» (line: 15, col: 14         


        
10条回答
  •  借酒劲吻你
    2020-11-28 20:53

    If Radovan's answer isn't working for you due to a problem in a library instead of your code, you can try upgrading Uglifier and enabling ES6 compilation.

    Gemfile.lock

    gem 'uglifier', '~> 4.1'
    

    config/environments/production.rb

    config.assets.js_compressor = Uglifier.new(harmony: true)
    

提交回复
热议问题