-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
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
Error with Rails 5 in production env #403
Comments
Are you using ruby 2.2.1+? |
Yes, ruby 2.2.3p173 |
Maybe a bug in react-rails. Others will comment. |
I think it's the same problem as #288, but now it totally 💥s instead of just being inefficient. Sorry I haven't gotten a chance to fix it yet! Maybe this afternoon. |
Any progress on this? I'm seeing this issue on Rails 4.2.5 with Ruby 2.1.5 and Sprockets 3.5.2 (Sprockets-rails 3.0) |
This 💥 s for us when precompiling assets, even though we aren't using config.react.server_renderer = Class.new do
def initialize(params = {})
end
def render(component_name, props, prerender_options)
''
end
end Can @rmosolgo comment if this would have any negative consequences I'm not thinking of if we're not using server side rendering? |
If you're not using server-side rendering, I can't imagine any negative consequences! That's a nice application of the null object pattern :) Sorry I've been kicking the can on this, just installed the new Rails 5 beta to reproduce the issue locally! |
I reproduced the issue locally and "fixed" it with this patch: #430 Still a few things to do there but at least I can see the way forward :D |
Thanks! |
Any quick workaround for new comers? |
You could try: #443 (comment) |
I guess this is fixed on recent versions, please let me know if it isn't!! |
Rails 5 : rails/rails@472b8e0
react-rails : 290765a
Sprockets : rails/sprockets@c8b96cd
When deploying in the production env, I get this error :
The error occurs here :
react-rails/lib/react/server_rendering/sprockets_renderer.rb
Line 14 in 290765a
After looking in the console,
Rails.application.assets
is empty in this environment. Settingconfig.assets.compile = true
inconfig/environments/production.rb
fixes the issue.I dont really know how this can be fixed otherwise, this is my first try at react / react-rails.
The text was updated successfully, but these errors were encountered: