-
Notifications
You must be signed in to change notification settings - Fork 752
Closed
Description
Rails 5 : rails/rails@472b8e0
react-rails : 290765a
Sprockets : rails/sprockets@c8b96cd
When deploying in the production env, I get this error :
NoMethodError: undefined method `[]' for nil:NilClass
File ".../bundle/ruby/2.2/bundler/gems/react-rails-290765a1ac14/lib/react/server_rendering/sprockets_renderer.rb" line 14 in block in initialize
File ".../bundle/ruby/2.2/bundler/gems/react-rails-290765a1ac14/lib/react/server_rendering/sprockets_renderer.rb" line 13 in each
File ".../bundle/ruby/2.2/bundler/gems/react-rails-290765a1ac14/lib/react/server_rendering/sprockets_renderer.rb" line 13 in initialize
File ".../bundle/ruby/2.2/bundler/gems/react-rails-290765a1ac14/lib/react/server_rendering.rb" line 22 in new
File ".../bundle/ruby/2.2/bundler/gems/react-rails-290765a1ac14/lib/react/server_rendering.rb" line 22 in create_renderer
File ".../bundle/ruby/2.2/bundler/gems/react-rails-290765a1ac14/lib/react/server_rendering.rb" line 12 in block in reset_pool
The error occurs here :
js_code << ::Rails.application.assets[filename].to_s |
After looking in the console, Rails.application.assets
is empty in this environment. Setting config.assets.compile = true
in config/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.
Metadata
Metadata
Assignees
Labels
No labels