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

后端 未结 10 1411
小鲜肉
小鲜肉 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:41

    In my case problem with function definition like,

    function someFunctionName(param1, param2=defaultValue){
      //code 
    }
    

    Due to above function definition I was getting error, as it is not supported by Uglifier. Default parameters is ES6/ES2015 language specification.

    For solution to above problem you can refer Set a default parameter value for a JavaScript function

提交回复
热议问题