Looking for a way to determine where in my code or in the ember-rails/ember-rails-source this error is coming from. Using rails 3.2 and the latest ember-rails 0.19. When I precompile my assets I get this failure:
Unexpected token: operator (!) (line: 16, col: 178179, pos: 178546)
Error
at new JS_Parse_Error (<eval>:3096:22)
at js_error (<eval>:3104:15)
at croak (<eval>:3557:17)
at token_error (<eval>:3564:17)
at unexpected (<eval>:3570:17)
at Object.semicolon [as 1] (<eval>:3590:51)
at prog1 (<eval>:4133:29)
at simple_statement (<eval>:3726:35)
at <eval>:3634:35
at block_ (<eval>:3822:32)
(in /Users/sjustin/Development/my-app/app/assets/javascripts/application.js.coffee)
I've been able to destructively get the assets to precompile by removing the Ember Sprockets reference, #= require ember
in my application.js.coffee
:
#= require jquery
#= require jquery_ujs
#= require ember
#= require ember-data
#= require_self
#= require my-app
window.MyApp = Ember.Application.create()
But that breaks the app. If I run the app locally without precompiling I don't get any errors from Rails or the JavaScript console.
Which javascript runtime (eg therubyracer
, execjs
, nodejs
) are you using? Have you tried to switch it? I'd recommend using node (especially if you're running multiple apps on a single server), because you don't have to add a gem if node is installed.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.