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
react-hot-loader may break the app in Webpack 5.0.0-beta.14 and up #1449
Comments
Is a good idea. There is no need to apply any "hot" stuff on the "static" node_modules Additionally, you can pass |
* Replaces the phrase "It is safe to enable this loader for all the files" with "It is _possible_ to enable...", because it's neither safe (as proven in #1449) nor usually necessary. * Switches first example of Webpack config (suboptimal, applying loader to all the files) with the second one (optimal, applying loader to react-dom only, if you're using babel plugin)
Is there any progress? |
React-Hot-Loader is deprecated. There are newer variants based on FastRefresh compatible with wp5 |
@theKashey I see. Thank you! |
@kahirokunn And also instructions for this deprecated package were updated to keep people from falling into this trap, see #1452. |
but not support react 15. |
Not sure why you use still React 15 (at least in dev mode). 16 is 100% backward compatible. |
Note: This has also been reported in Webpack repo.
Description
I'm getting an error "ReferenceError: exports is not defined" when running the application that uses with
react-hot-loader
and importsd3-array
built with Wepack 5.0.0-beta.14 and up.Expected behavior
"Uncaught ReferenceError: exports is not defined" not to be thrown when executing Webpack-bundled code.
Actual behavior
Here's the exact error:
Any of the following seem to unbreak the app:
d3-array
import (duh)export default hot(Root)
->export default Root
react-hot-loader/webpack
loader to/node_modules\/react-dom/
only and not/node_modules/
Tested other versions of Webpack, changing absolutely nothing but the Webpack version, and here's my findings:
Environment
React Hot Loader version: 4.12.21
Run these commands in the project folder and fill in their results:
node -v
: 12.16.2npm -v
: 6.14.4Then, specify:
Reproducible Demo
Reproducible repo
The text was updated successfully, but these errors were encountered: