Skip to content

Cannot GET / - Fresh install rails g newapp --webpack=react #1584

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
robSturcke opened this issue Jun 23, 2018 · 1 comment
Closed

Cannot GET / - Fresh install rails g newapp --webpack=react #1584

robSturcke opened this issue Jun 23, 2018 · 1 comment

Comments

@robSturcke
Copy link

robSturcke commented Jun 23, 2018

Can't get the react components of application.js or hello_react.jsx to load when placing the pack_tag: <%= javascript_pack_tag 'hello_react' %> in my application.html.erb or index.html.erb

Running both ./bin/webpack-dev-server and rails s

Tried adding a index.html file in my public > packs directory but it loads as plain text. (Advice from issue #1325 ).

What am I missing? Not looking for hot reloading, just trying to get this to load a react component.

I also tried react-rails but even with importing <%= react_component("HelloWorld", { greeting: "Hello" }) %> from a generated component I'm getting the same issue on localhost:3035. I tried changing it to localhost:3000 in the webpack config but same result.

@miguelpeniche
Copy link

Hi Rob, did you resolve this?

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

2 participants