Coffeescript compilation error in ruby on rails

后端 未结 2 1476
长发绾君心
长发绾君心 2021-01-04 20:13

I am using coffeescript+ruby-on-rails. The compilation of coffeescript into pure JS leads to an error if there is a syntax problem in the coffee code. On the browser when I

相关标签:
2条回答
  • 2021-01-04 20:51

    You can use an online linter like http://www.coffeelint.org/ if you know its coffeescript causing the error

    0 讨论(0)
  • 2021-01-04 20:55

    One workaround is to compile your .coffee files outside rails to get a decent error message:

    If you don't yet have it:

    npm i coffee-script -g
    

    Then in a parent directory of your .coffee files:

    coffee --output deleteme --compile .
    

    When you're done, delete the deleteme folder it created (which is only created if you fix all the errors). This should find the syntax error for you and tell you exactly where it is.

    0 讨论(0)
提交回复
热议问题