gaearon / react-hot-loader

Tweak React components in real time. (Deprecated: use Fast Refresh instead.)

Home Page:http://gaearon.github.io/react-hot-loader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

alex123bob opened this issue · comments

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?

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.

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

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.