Questions tagged [react-on-rails]
112 questions
2
votes
1 answer
React on Rails - ! [remote rejected] master -> master (pre-receive hook declined)
I'm working in rails 4.2.5, recently I have added react_on_rails in my app. I am getting the error(mkdir: cannot create directory) when I try to deploy the code on Heroku. App uses couple of webpacks one for Ruby and another for Node.
git push…

Sampat Badhe
- 8,710
- 7
- 33
- 49
2
votes
0 answers
Accessing webpack assets from rails app
I'm using webpack with React on Rails and have some react components that need to reference images.
The problem I'm having is trying to get Rails to access the images. Rails has its images served from its usual app/assets/images directory which is…

Riina
- 530
- 1
- 7
- 19
2
votes
1 answer
React on Rails Gem - Foreman Thor Conflict
I've been trying to implement the react_on_rails gem using the tutorial found here.
Difference being I'm using ruby 2.3.3, node 7.2.0, and ran the setup with redux (rails generate react_on_rails:install --redux)
However now when I try to run foreman…

Ryan King
- 3,538
- 12
- 48
- 72
1
vote
1 answer
Issue importing createRoot from "react-dom" in React on Rails
I am trying to create a React on Rails project for the first time. I have
"react": "^18.2.0",
"react_ujs": "^2.6.2",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
And I am trying to create a router (as per the tutorial here)
import React…

H Zaman
- 43
- 5
1
vote
0 answers
ReactOnRails pre-rendering error after deploying web app with new Ruby and Node versions with Capistrano
Background of the problem
My website is a Rails webapp running the Sharetribe open source code, with Puma & React on Rails to pre-render components. It has a TopBarApp component built by Sharetribe that displays top menus like Home, About, etc.
We…

Lun
- 428
- 4
- 20
1
vote
1 answer
React on Rails argument error when prerender is true
Setting prerender: true in index.html.erb
<%= react_component('App', props: @props, prerender: true) %>
Triggers the following error
ActionView::Template::Error (wrong number of arguments (given 1, expected 0)):
Here's the…

yeniv
- 93
- 8
1
vote
0 answers
How to reduce rails slug size on a react/rails project
I have a project with a ruby buildpack and a react buildpack the total slug size is about 109.8mb, the react side comes out to about 900kb (largest gzipped file 300kb), so I take this to mean that ruby side is taking up 108.9mb on the total slug…

Jay
- 83
- 1
- 10
1
vote
1 answer
Rails + React-I18next : can't find locales/
I want to integrate React-I18next in my React on Rails app (i'm using webpack).
The problem is react-i18next can't find my locales folder...
Where can I put my locales ?
in the public folder of rails ? (not working..)
i create a new public folder in…

Theo Cerutti
- 779
- 1
- 10
- 33
1
vote
1 answer
Why would Webpack 4 minification prevent styles for react-select component?
I have a React project that is bundled by Webpack and served up by react_on_rails. In this project I use the Select component from react-select. Everything works as expected when using Webpack 3. After upgrading to Webpack 4, everything also works…

ryanrombough
- 11
- 3
1
vote
1 answer
React on Rails - environment.toWebpackConfig is not a function
I'm using the react_on_rails gem to add a react frontend to our existing rails backend. I'm having a lot of trouble getting everything up and running. It took like an entire day just to get the gem working properly because it didn't work correctly…

Elliot Tregoning
- 213
- 4
- 16
1
vote
1 answer
How can I make a config file to import the same modules for multiple jest tests?
I have tests for jest written in jsx files with these same lines of code:
import React from 'react';
import { configure } from 'enzyme';
import { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new…

Taariq
- 61
- 8
1
vote
1 answer
Can React on Rails be integrated into an existing Rails 3.x app?
The prerequisites from the README say "React on Rails supports older versions of Rails back to 3.x" so I was led to believe it could. But then during the install process I see I have to install webpacker. And there's the note "Rails/webpacker…

evanrmurphy
- 1,826
- 1
- 18
- 19
1
vote
1 answer
Module parse failed: Unexpected character '@' when using React on Rails with Antd.
I'm using React on Rails and have been trying to use Antd UI framework.
I have successully imported components from 'antd' like buttons and Datepickers
import { Button } from 'antd';
but they are not styled at all. Looking at my server I have the…

SegFaultDev
- 455
- 1
- 7
- 24
1
vote
0 answers
Webpack cannot import module file when it exists in production
This only occurs when I am trying to deploy to production both on Heroku and AWS Elastic beanstalk so I know it has to do with my application.
When deploying and failing, the logs read:
Module not found: Error: Can't resolve './components/waitlist'…

Jeff
- 650
- 5
- 16
1
vote
0 answers
fetch data to React from Rails
On my Meals#index page, I want to display a map that renders all restaurants that are inside the displayed-map's boundaries. (each meal belongs to a restaurant, the map is actually displayed along with a list of meals, like the AirBnB search page…

Uj Corb
- 1,959
- 4
- 29
- 56