Closed OscarBarrett closed 11 years ago
I just created a test project using activeadmin 0.6.1 (the latest release) and ngmin-rails 0.4.0 and can't reproduce the issue.
I had the same issue processing a .coffee file Error: Line 1: Unexpected token ILLEGAL (in /home/james/.rvm/gems/ruby-1.9.3@mygemset/gems/haml_coffee_assets-1.15.0/vendor/assets/javascripts/hamlcoffee.js.coffee.erb)
My workaround was to bundle open ngmin-rails
and insert the following line:
def evaluate(context, locals)
return data if context.pathname.basename.to_s.match(/.*\.(coffee|jst).*/)
I'm sure there's a less hacky way of doing this. Maybe setting the initializer load order so ngmin-rails operates after coffee processing?
We have been migrating a site to a new cluster of servers that are using nodejs as the JS runtime (as therubyracer was causing issues). During asset precompilation, it seems that ngmin-rails is trying to parse one of the ActiveAdmin CoffeScript files as JavaScript instead.
Here is the output of
rake assets:precompile
:Here is the contents of the file in question (namespace.js.coffee):
As you can see, the first line is a valid comment for CoffeeScript only, and parsing it as JavaScript will throw an illegal token error.
The gems that we are using:
rake assets:precompile
succeeds if we remove ngmin-rails from the Gemfile.