-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
webpack compiler cannot be reused across server instances #3033
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
Comments
It is limitation, you need to create two |
It is not safe to use |
@alexander-akait Thank you for the quick reply. This was to elaborate on #2920 (review). The related discussion was #2723 (review) and it seems this has worked before and I remember there was a test case to test this. I agree it'd be hard to implement and maintain the ability to reuse it. What do you think about raising an error if the compiler instance is reused, i.e., Server is created with the compiler which server has already been added to? |
Sounds good |
Uh oh!
There was an error while loading. Please reload this page.
Code
Reproducible repo: https://github.com/ylemkimon/multiple-dev-server-instance
Expected Behavior
In the second server:
Actual Behavior
In the second server:
For Bugs; How can we reproduce the behavior?
git clone https://github.com/ylemkimon/multiple-dev-server-instance.git cd multiple-dev-server-instance npm install npm start
Additional information
This is because webpack hooks cannot be modified or removed after they've been added. So hooks of the middleware and entry are added twice and/or not updated:
webpack-dev-server/lib/utils/DevServerPlugin.js
Lines 169 to 172 in 2e2190a
I think this can be resolved in two ways:
The text was updated successfully, but these errors were encountered: