问题描述
我正在尝试将我的应用程序部署到Heroku,但是它引发了这个错误。
我认为这是错误的
根据Iceman的建议,我尝试运行该命令
它说
我的图像文件有问题吗?
正如一些用户提到的,问题是Rails JS uglifier无法处理ES6模板文字。
Uglifier现在具有支持ES6 / ES2015 +语法的Harmony模式。
您可以通过传递 打开 替换 与 I am trying to deploy my app to Heroku but its throwing me this error. I assume there is something wrong with the coffeescript/javascript. I have deleted all of my coffeescript files and I dont know what I'm doing wrong. As suggested by Iceman, ive tried running the command and it says is there something wrong with my image files? The problem, as some of the users has mentioned, is Rails JS uglifier not being able to handle ES6 template literals. Uglifier now has a Harmony mode which supports ES6 / ES2015+ syntax. You can enable it by passing Open Replace with 这篇关于将Rails应用程序部署到Heroku时的语法错误:ExecJS :: RuntimeError:SyntaxError:意外字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!:harmony =>来启用它
config / environments / production.rb
config.assets.js_compressor =:uglifier
config.assets.js_compressor = Uglifier.new(harmony:true)
:harmony => true
option to Uglifier.config/environments/production.rb
config.assets.js_compressor = :uglifier
config.assets.js_compressor = Uglifier.new(harmony: true)