We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#430 introduced the ManifestContainer which uses Rails.application.assets_manifest. This method was introduced by sprockets-rails 2.2.2. If Rails.config.assets.compile is set to false (which it is by default in production) SprocketsRenderer no longer uses EnvironmentContainer and causes the exception:
ManifestContainer
Rails.application.assets_manifest
sprockets-rails
Rails.config.assets.compile
false
SprocketsRenderer
EnvironmentContainer
ActionView::Template::Error (undefined method `assets_manifest' for #<Xxx::Application:0x007f5464c7b180>): react-rails (1.6.2) lib/react/server_rendering/manifest_container.rb:9:in `initialize' react-rails (1.6.2) lib/react/server_rendering/sprockets_renderer.rb:70:in `new' react-rails (1.6.2) lib/react/server_rendering/sprockets_renderer.rb:70:in `asset_container' react-rails (1.6.2) lib/react/server_rendering/sprockets_renderer.rb:22:in `block in initialize'
I can see two possibilities:
There are Rails version though (e.g. 4.0.5) that depend on sprocket-rails ~> 2.0.0.
sprocket-rails ~> 2.0.0
The text was updated successfully, but these errors were encountered:
Hmm, I see what you mean, that logic for choosing a container could be improved. Option 1. sounds best to me, do you want to give it a try?
1.
In the meantime, I think you can work around it by manually choosing EnvironmentContainer:
React::ServerRendering::SprocketsRenderer.asset_container_class = React::ServerRendering::SprocketsRenderer::EnvironmentContainer
Sorry, something went wrong.
Yes, that's what I did. I can submit a PR. Do you want me to feature detect assets_manifest with repond_to? or check Sprockets::Rails::VERSION?
assets_manifest
repond_to?
Sprockets::Rails::VERSION
feature detection sounds good to me!
I'll submitted a PR (#545). Would be great if you could take a look.
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
#430 introduced the
ManifestContainer
which usesRails.application.assets_manifest
. This method was introduced bysprockets-rails
2.2.2. IfRails.config.assets.compile
is set tofalse
(which it is by default in production)SprocketsRenderer
no longer usesEnvironmentContainer
and causes the exception:I can see two possibilities:
EnvironmentContainer
forsprockets-rails
< 2.2.2sprockets-rails
dependency explicitThere are Rails version though (e.g. 4.0.5) that depend on
sprocket-rails ~> 2.0.0
.The text was updated successfully, but these errors were encountered: