I am experiencing a ReferenceError with react-hot-loader:
ReferenceError: firstCurrentHook is not defined
at Object.hotCleanupHooks [as hotCleanup] (http://localhost:3000/scripts/vendor.js:277033:20)
at cleanupReact (http://localhost:3000/scripts/vendor.js:280427:14)
at reconcileHotReplacement (http://localhost:3000/scripts/vendor.js:280888:3)
at renderReconciler (http://localhost:3000/scripts/vendor.js:280902:7)
at Object.asyncReconciledRender [as componentWillRender] (http://localhost:3000/scripts/vendor.js:280910:3)
at AppContainer.hotComponentUpdate (http://localhost:3000/scripts/vendor.js:279651:19)
at AppContainer.render (http://localhost:3000/scripts/vendor.js:281128:12)
at finishClassComponent (http://localhost:3000/scripts/vendor.js:268892:33)
at updateClassComponent (http://localhost:3000/scripts/vendor.js:268860:12)
at beginWork (http://localhost:3000/scripts/vendor.js:269485:16)
at performUnitOfWork (http://localhost:3000/scripts/vendor.js:272317:16)
at workLoop (http://localhost:3000/scripts/vendor.js:272346:26)
at renderRoot (http://localhost:3000/scripts/vendor.js:272377:9)
at performWorkOnRoot (http://localhost:3000/scripts/vendor.js:272952:24)
at performWork (http://localhost:3000/scripts/vendor.js:272873:9)
at performSyncWork (http://localhost:3000/scripts/vendor.js:272850:5)
React Hot Loader version: 4.7.2
Run these commands in the project folder and fill in their results:
node -v: v11.9.0npm -v: 6.8.0Then, specify:
I'll create a demo if needed. However, I suspect this is because I'm using versions of react and react-dom (16.3.2) that don't include hooks, and so don't define the hook-related variables that are cleaned up by react-hot-loader. Please let me know if I can provide more information or if you need a demo in order to diagnose this further.
:( It's more about which React version you use
Then - you dont need hot-patch - so disable webpack-loader for react-dom, or dont use hot-loader/react-dom, if you do.
Thanks for the quick reply. This incompatibility needs to be expressed somewhere. Does the overall project still support React 16.3?
If yes, then we probably just need a note in the documentation that the webpack plugin only supports react and react-dom 16.8.0 and above.
If no, then the peerDependencies in package.json need an update, which would be a breaking change and require a major version bump for react-hot-loader.
Let me know what you'd like to do and I can try to put a PR together.
We still maintain tests and compatibility with React 15, but sometimes something could go wrong, as long the main problem is to support new features.
excluding react-dom from webpack-loader is a one line in webpack configuration, and would help you __here and now__. Later I would fix webpack-loader not to break your app, but that would be not today.
Not sure if it's the version as we're seeing it also with React 16.8.4 and all other packages (RHL, Webpack etc.) up-to-date
馃憤 breaks with 16.8.4. Last tested version is 16.8.3 馃憤
[email protected] (or hot-loader/[email protected]) released
Thanks @theKashey! I tested 4.8.0 against react & [email protected] and confirmed those versions are working again, so I think this issue can be closed.
Thanks for reporting an issue in a right time :)
Most helpful comment
[email protected] (or hot-loader/[email protected]) released