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-dom patch can be broken when multiple version of react-hot-loader is installed #1222
Comments
Known issue - React-hot-loader shall not patch react and react-hot-loader. Like Babel plugin is not doing. Duplicate of #1209 |
OK, if my fix is not the ideal one, I'll wait :) |
I tried to exclude |
The issue is the same - stack track is the same (shellscape/webpack-plugin-serve#117)
React-Hot-Loader got injected into Meanwhile, I let me try to fix it from webpack-loader side. |
|
Anyone find an answer to this, i'm having the same issue. |
How to solve this issue? Any workaround? |
The problem shall not exists, unless you create it. So - if problem is driven by webpack-loader - limit it only to the file it has intention to patch. {
test: /\.js$/,
include: /node_modules\/react-dom/,
use: ["react-hot-loader/webpack"],
}, Also just - try updating RHL |
If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.
Description
I'm encapsulating all webpack and babel configurations into a CLI tool so that
react-hot-loader
may be placed under my tools, however there is anotherreact-hot-loader
installed from other packages depending on this:Expected behavior
We expect everything works fine in such structure.
Actual behavior
When the actual
react-hot-loader
patchesreact-dom
, it generates some error in runtime:To fix
The issue lies in webpackTagCommonJSExport.js, this file has a
require('react-hot-loader')
statement, however this is a generated code snippet inserted into other files, so thisrequire
call resolves to the one installed via other package.I fixed it by mark it as
require('%%REACT_HOT_LOADER_LOCATION%%')
and replace this keyword from its webpack-loader by adding an extra.replace
thereIf this solution is acceptable, I'd like to send a pull request for this
The text was updated successfully, but these errors were encountered: