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
webpack loader creates circular dependency when used with webpack-plugin-serve #1209
Comments
I filed a related issue here: shellscape/webpack-plugin-serve#117 but I'm guessing the real problem is in |
Thanks for the demo. Probably I know what is broken. |
@theKashey can you go into detail on what you think the cause is? is it something that can be fixed from within the plugin? |
Yeah, sorry - I really forget about this task :( |
So
import 'react-hot-loader'; // <-------
import React from 'react';
import ReactDOM from 'react-dom';
// .....
ReactDOM.render(<App />, document.getElementById('root')); You can also do the same trick by prefixing your entry with |
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
When attempting to run an ejected create-react-app app with react-hot-loader and webpack-plugin-serve, there is a circular dependency load which causes the app to fail to load.
The load appears to come from the register() function injected by
react-hot-loader/webpack
. It seems that the register() function is being run immediately after react.js is evaluated, but before it is fully exported.If I wrap the
register
function in asetTimeout
, it works fine because the circular dependency is broken.Expected behavior
What you think should happen:
It should work out of the box.
Actual behavior
What actually happens:
It doesn't, see description.
Environment
React Hot Loader version: 4.8.4
Run these commands in the project folder and fill in their results:
node -v
: 10.9.0npm -v
: 6.8.0Then, specify:
Reproducible Demo
https://github.com/aaronjensen/hot-serve-repro
The text was updated successfully, but these errors were encountered: