Coffeescript compilation error in ruby on rails

后端 未结 2 1475
长发绾君心
长发绾君心 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: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.

提交回复
热议问题