Skip to content

react_component not rendering on production mode #1076

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

Closed
superdev093 opened this issue Jul 6, 2020 · 4 comments
Closed

react_component not rendering on production mode #1076

superdev093 opened this issue Jul 6, 2020 · 4 comments

Comments

@superdev093
Copy link

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.

@LuisErnestoZamb
Copy link

I was facing the same issue, try to remove {prerender: false} and add ReactRailsUJS.mountComponents() at the end of app/javascript/packs/application.js

@TylerSustare
Copy link

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
image

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

@LuisErnestoZamb
Copy link

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,

Aesthetikx pushed a commit to Aesthetikx/react-rails that referenced this issue Apr 7, 2022
Changed Let to Var to avoid breaking down in older browsers
Will fix reactjs#1076
@alkesh26
Copy link
Collaborator

alkesh26 commented Nov 9, 2022

We have had no updates on this since 2020. Closing the issue. Feel free to reopen it.

@alkesh26 alkesh26 closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants