ExecJS coffee script not showing line numbers for compile errors (Rails asset pipeline)

让人想犯罪 __ 提交于 2019-12-03 02:37:14

I figured it out -- it's due to the coffee-script-source gem version. In the app that was giving line numbers, bundle show gives coffee-script-source of 1.4.0, whereas the other app had a coffee-script-source version of 1.6.1.

I didn't notice this because the coffee-rails gem doesn't tightly specify this dependency (in both my Gemfiles, I was using gem 'coffee-rails', '3.2'). To get around this, just explicitly specify the coffee-script-source gem version:

gem 'coffee-rails', '3.2.2'
gem 'coffee-script-source', '1.5.0'

and bundle update coffee-script-source.

Hopefully this helps anyone else who might run into this discrepancy.

This can also be fixed with this patch that embeds the line information in the error message for the ruby-coffee-script gem.

If you're using source maps, this patch fixes the coffee-rails-source-maps gem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!