我在 Rails 4 应用程序中使用 jit 树。 http://philogb.github.io/jit/ 。 在本地使用它时,我没有收到任何错误。但是当我将应用程序部署到 heroku 中时,我在 Assets 预编译上收到以下错误。
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
SyntaxError: Invalid regular expression: /(C-1))}z.computePositionStep(A,y);if(C&&x>=C) {B.onComplete();return}}B.onStep(Math.round(x/: Unmatched ')'
(in /tmp/build_tposeydajlt8/app/assets/javascripts/application.js)
最佳答案
尝试格式化代码中的特定行。通常,当您在除法之前有后置/前置增量时,它会抛出此错误。例如,如果您有,
i++/(C-1)
成功
(i++)/(C-1)
关于javascript - Jit Tree JS 和 Assets 预编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17366385/