Closed tjgrathwell closed 8 years ago
have the same issue
@tjgrathwell as I have this issue too, I tried your sprockets4
branch you did but it's still failing with the some error.
I have then checked the version of sprockets I'm using :
irb(main):001:0> Gem::Version.new(Sprockets::VERSION)
=> #<Gem::Version "3.5.2">
so it seems that your branch is not compatible with sprockets 3.x.
@zedtux I've added a second PR (#146) with the gem version requirement changed, so if you want you can test using
gem 'handlebars_assets', github: 'tjgrathwell/handlebars_assets', branch: 'sprockets-register-transformers'
@tjgrathwell I think master is now in a working state, I still want to do some manual testing over the next week. I have ran against sprockets 3.x and 2.x, it seems to work. I am just not 100% on the rails engine integration at this time.
@AlexRiedler Seems to work for me on all combinations of sprockets-rails 2/3 and sprockets 3/4. Hopefully still works against Sprockets 2.x if you're still interested in that. Good work!
@tjgrathwell your branch sprockets-register-transformers
works fine.
Do you already know, when a release with this fix will be available?
+1 for @tjgrathwell solution - working fine in both development and production environments..
+1 the fix looks good to me
As a temporary fix for your application, you can simply lock the sprockets-rails
version in your Gemfile:
gem 'sprockets-rails', '~> 2.3'
gem 'sprockets-rails', '~> 2.3'
Not if you need sprockets >= 3…
@kostia Well no, obviously not. Hopefully a proper fix will be released soon - my suggestion is only a temporary workaround that should be good for the majority of applications.
Perfect time to refactor to react.
@leshill Any word on a new release? The code on master has been working alright for me.
+1
Release of v0.23.0 should fix all your wonderful problems :) Release Today!
Works for me, thanks! :cake:
Thanks!
Awesome, all is now working fine ! Thank you @AlexRiedler :+1:
sprockets-rails 3 was just released, and apparently
app.assets
is now nil at initializer-time, soapp.assets.register_engine
won't work.One possible solution is to use
config.assets.configure do |env|
instead, which seems to be the more 'proper' way:Another solution is to use the new
register_transformer
code from https://github.com/leshill/handlebars_assets/pull/135 but relax the constraint onSprockets::VERSION
so it also applies to Sprockets 3. Theregister_transformer
syntax should work in Sprockets 3 and up, and that code will be needed for Sprockets 4 anyway.Related issue in the sprockets-rails repo: https://github.com/rails/sprockets-rails/issues/237