ShakaCode | ShakaCode Blog | Rails On Maui Blog | Rails | ReactJs | JavaScript | Webpack | Productivity |

ReactOnRails gem and node package MAJOR versions do not match


#1

Hi,

I am starting a new project with the react_on_rails gem that I’ve been looking at for some months with a lot of interest.

When making the latest deploy to Heroku I got the following message:

  ReactOnRails gem and node package MAJOR versions do not match.

I understand that the version checker installed by the gem https://github.com/shakacode/react_on_rails/blob/master/lib/react_on_rails/version_checker.rb is complaining about version mismatches.

Indeed, my gem version is 3.0.6 and my node package 4.0.0-beta.1

I guess that at some point when setting up the project, I ran both this command:

cd client && npm i --saveDev react-on-rails

which I now understand is intended for manual install and this one:

rails generate react_on_rails:install

My package.json file effectively lists react-on-rails 4.0.0-beta.1 as a dependancy.

Is it safe to keep it as currently is (with the version mismatch) or should I solve this issue?

And if I have to solve this issue, is it safe just to amend my package.json file and require version 3.0.6 of the react_on_rails node package as dependency?

I am still at a very early stage with this project and have not yet started to fiddle around in the client directory and/or with all the goodies provided by React_on_rails.

Many thanks and thanks a lot for the good work of packaging everything so nicely!!!


#2

OK. Solved this.

This was related to the fact that at the time I made the first install of the gem, the home page for react_on_rails on github has not yet been updated and still mentionned:

gem "react_on_rails", "~> 3"

and when doing the

bundle && npm i

as instructed by the installer, npm updated the version of the npm package.

Pretty satisfied with the new version of the gem which does no longer “eat up” my console when starting traditionally with a simple rails s and doing a byebug in my code.

One thing I do not understand though: I am using the better-errors and the rendering on the interactive console page of better-errors is so slow that it makes it useless. This is sad.

But anyway, thanks for the effort in package all this.


#3

@CedricLor I’m glad you solved the issue. Be sure to update the latest version of React on Rails.