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

It pops up error "node_modules/react-hot-loader/index.js didn't return a function" after upgrading react to 16.x and react-hot-loader to 4.x #1411

Open
alex123bob opened this issue Jan 8, 2020 · 3 comments

Comments

@alex123bob
Copy link

alex123bob commented Jan 8, 2020

I have to upgrade React to 16.x from 15.x due to some requirements. However, an error pops up “module not found : Error: Cannot resolve module 'react/lib/ReactMount' ”. I solved this by upgrading react-hot-loader from 1.x to 4.x as old version relies on ReactMount that can't be found in new version. Unfortunately, a new error which I mention in title pops up afterwards. Been googling for a while, can't find a proper solution on it.

image

Anyone met the same thing?

@alex123bob alex123bob changed the title It pops up error "node_modules/react-hot-loader/index.js" didn't return a function after upgrading react to 16.x and react-hot-loader to 4.x It pops up error "node_modules/react-hot-loader/index.js" didn't return a function after upgrading react to 16.x and react-hot-loader to 4.x Jan 8, 2020
@alex123bob alex123bob changed the title It pops up error "node_modules/react-hot-loader/index.js" didn't return a function after upgrading react to 16.x and react-hot-loader to 4.x It pops up error "node_modules/react-hot-loader/index.js didn't return a function" after upgrading react to 16.x and react-hot-loader to 4.x Jan 8, 2020
@theKashey
Copy link
Collaborator

What else you might need to upgrade?
Quick googling tells me - webpack, or at least some webpack loaders, or at least Loader which complains in this case.

@alex123bob
Copy link
Author

Just need upgrade react to 16.x
Yeah, loader complains in this case. However I looked into index.js and patch.js in react-hot-loader, it seems not different from the others, e.g. sass-loader.

@theKashey

@theKashey
Copy link
Collaborator

I mean - please consider updating other packages to a bit modern state, as well as they could be a bit dusty, as RHL v1 or React v15 were.

Unfortunately, I am not able to help you with your problem - it's somehow bound to your specific configuration and case.

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