-
Notifications
You must be signed in to change notification settings - Fork 756
Rails 4 to 5 upgrade #747
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
Comments
It seems like |
I just ran //= require rails-ujs
//= require turbolinks
//= require jquery
//= require bootstrap-sprockets
//= require react
//= require react_ujs
//= require components
//= require_tree . |
Are there any other errors in the console? Is it possible that |
Hmm... I think I've got I get there error here:
because ReactDOM is undefined. |
I am facing this same issue. Have you found any workaround? |
@BookOfGreg can you tell us what the recommended versions of this gem are to the latest versions of Rails? I'm facing the exact same on a Rails 4.2 app. If this is in fact the problem. Could we add a small table on the readme page for version matching so people can look up? I'd be happy to help adding the PR, but I don't have the content. |
@thejamespinto I added a branch to the example app of Rails 4 + React-rails 2.4, installed as per the sprockets readme. example-Rails-4 It appears to work but this is only a simple example, is it possible to show a simple reproduction of the issue? |
I wish :( Unfortunately, the application I am working with cannot be upgraded right now, and that's true for many rails apps out there. @BookOfGreg I really think this is one of those projects that require a compatibility table for this exact reason. Thank you for maintaining it up-to-date. ❤️ |
@thejamespinto are you running mini_racer or therubyracer? We stopped supporting therubyracer a while back because it is utter rubbish at keeping up to date (running libv8 3 or something daft) Trouble with this gem at the moment is we support many versions of "Options", you can't specify minimum versions of something that is optional. For example we support both Sprockets from V2 and Webpacker from V1.1, but I can't change the Gemspec to reject Sprockets 1 because that would stop you using webpacker, or force to install both. Any work I do to make a "golden" path (Webpacker > 2, Libv8 > 5, Rails > 4) risks cutting off huge chunks of users doing anything off the beaten path. |
@BookOfGreg I'm part of a sad minority here because I'm using an old version of Rails and I want to add ReactJS to my project before upgrading Rails. To be completely honest, I have already solved my compatibility issue by installing an older version and adding a future task for when upgrading Rails, and I could be out of this conversation already, but I know there are a lot of developers out there who would not take such precautions. I think it is important to find a way to help them because that increases the adoption of ReactJS within the Rails community. So here's a suggestion: How about not changing the gem specs, but instead running a short script when the gem is required/initialized that verifies inconsistencies and outputs suggestions? I don't think anybody can write it spot-on the first time around, but that would help cater a self-fixing aspect feature from the community feedback. I'd be happy to commit to patching this feature from three projects I have lined up to add ReactJS to. Best, James. |
@thejamespinto did you manage to upgrade to a newer react-rails version since? Been a crazy busy few months, agree that driving adoption of react + rails is a good thing, been leaning on this gem heavily on professional projects in the past few months, thankfully all Webpack + Rails 5 so smooth sailing for my work. Unfortunately smooth sailing means work doesn't tend to sponsor me fixing problems, also given that I changed jobs lately. |
Having an issue updating a Rails 4 app to Rails 5. Seeing the problem where ReactDOM.render fails because ReactDOM isn't defined. Part of this, is updating from 1.5.0 react-rails to 2.4.4 as part of updating a Rails 4.2 app to Rails 5.2. Simply adding 'react-dom' to application.js fails because Sprockets doesn't believe it exists. Any suggestions? |
Is there a solution to this issue? I was having this error on Rails 4.2 so I upgraded to 5.2 (needed to do it anyway), but I get the same error. I'm not using therubyracer. I'm on the latest version of react-rails (2.5.0). |
Nobody has provided a reproduction so I don't know what the issue is. |
Closing due to inactivity. |
Help us help you! Please choose one:
react-rails
, so I've included the stack trace and the exact steps which make it crash.react-rails
with another library, but I'm having trouble. I've described my JavaScript management setup (eg, Sprockets, Webpack...), how I'm trying to use this other library, and why it's not working.Hi,
I was using
react-rails
fine with Rails 4, but it stopped working when I updated to Rails 5.If I do
<%= react_component('New') %>
, I only get the below output and not the actual content.To figure out if it had any conflicts with other gems, I even created a new Rails 5 project. Still the same issue.
Below is the log I get in the console.
Any help would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: