react-rails
react-rails copied to clipboard
react_component not rendering on production mode
Help us help you! Have you looked for similar issues? Do you have reproduction steps? Contributing Guide
Steps to reproduce
(Guidelines for creating a bug report are available here)
Expected behavior
Tell us what should happen
Actual behavior
Tell us what happens instead
System configuration
Sprockets or Webpacker version: 4.2.2 React-Rails version: 2.6.1 Rect_UJS version: 2.6.1 Rails version: 4.2 Ruby version: 2.5.3
On development version i can see
react_component("History", {}, {prerender: false})
but on production mode not showing anything without any error.
I was facing the same issue, try to remove {prerender: false} and add ReactRailsUJS.mountComponents() at the end of app/javascript/packs/application.js
This same thing is happening to me. This little app https://github.com/TylerSustare/dinner/tree/react-rails-does-not-run-in-prod-mode only has one view and this happens with rails s -e production

logs
$ rails s -e production
=> Booting Puma
=> Rails 6.0.3.2 application starting in production
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.5 (ruby 2.7.1-p83), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Hi, that log doesn't match with the image, I believe that you should review carefully your logs or change the verbosity of this. Regards,
We have had no updates on this since 2020. Closing the issue. Feel free to reopen it.