Skip to content
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

Migration guide for create-react-app seems outdated #595

Closed
bernatfortet opened this issue Jun 25, 2017 · 11 comments
Closed

Migration guide for create-react-app seems outdated #595

bernatfortet opened this issue Jun 25, 2017 · 11 comments

Comments

@bernatfortet
Copy link

bernatfortet commented Jun 25, 2017

Described migration for create-react-app results in errors.
https://github.com/gaearon/react-hot-loader/tree/master/docs#migrating-from-create-react-app

From fresh install, I followed the instructions from the docs, and when I change a component the app refreshes completely instead of hot-reloading components

Also, it's not said, but it's required to import findCacheDir:
const findCacheDir = require('find-cache-dir');

@ivanwolf
Copy link

Same issue here.
I removed the options in the babel loader in order to add the query. Then add AppContainer to the root index.js including the module.hot stuff.
It worked for me.

@1-800-jono
Copy link

Hey @ivanwolf15 can you explain a bit the changes you made to get this to work?

Can you provide the code you changed here? Been dealing with this for days now.

Thanks

@casprwang
Copy link

casprwang commented Jul 23, 2017

Hi @jonathanphz If you are still trying to figure this out, I created a repo to show you how. create-react-app-with-hot-loader

@1-800-jono
Copy link

Hey @wangsongiam thanks so much for this - I was able to figure it out slowly a few days ago.

BTW - I love your editor. Is that vim using Hyper?

@casprwang
Copy link

@jonathanphz thanks! It's Neovim on iTerm, you can check my config repo for all the details.

@1-800-jono
Copy link

Just tried following along the docs in here: https://github.com/gaearon/react-hot-loader/tree/master/docs#migrating-from-create-react-app

Using a fresh install of CRA and react-hot-loader@next.

When attempting to yarn start I get this error:Provided options and query in use error Command failed with exit code 1.

@gregberge
Copy link
Collaborator

@jonathanphz if you fixed it can you please update the documentation?

@Grimones
Copy link

Grimones commented Oct 19, 2017

Same issue here. Using latest RHL and CRA.
followed https://github.com/gaearon/react-hot-loader/tree/master/docs#migrating-from-create-react-app
still reloads page.
I Also have cloned https://github.com/wangsongiam/create-react-with-hot-loader and made fresh install. Added simple counter and the counter resets on code change, obviously page refreshes.

Tried to use
require.resolve('webpack-dev-server/client') + '?/',
require.resolve('webpack/hot/dev-server'),

In console shows [HMR] Waiting for update signal from WDS... but no [WDS] Hot Module Replacement enabled.
I think this is better than silence from HMR when using require.resolve('react-dev-utils/webpackHotDevClient'). Or it isn't related to this?

@Grimones
Copy link

@neoziro
Hi! You can close this issue. I can confirm that current migration guide is working properly with fresh CRA.
Here is the repository https://github.com/Grimones/cra-rhl
The diff
https://github.com/Grimones/cra-rhl/commit/f9f7b67568f6e8d9f3a8d3293422a9f4d5d2c28a

@gregberge
Copy link
Collaborator

@Grimones thanks, can you please review it for v4?

@Somebi
Copy link

Somebi commented Feb 10, 2019

Problem still persists

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

7 participants