-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
-
Operating System: osx
-
Node Version: 14.15.0
-
NPM Version: 6.14.8
-
webpack Version: 5.8.0
-
webpack-dev-server Version: 4.0.0-beta.0
-
Browser: Chrome
-
This is a bug
-
This is a modification request
Code
When the port is left unspecified (both in CLI args and in webpack config), webpack-dev-server finds a port, defaulting to 8080 when possible. However, the webpack-dev-server client code is not aware of which port was chosen, and the resource query for setting up the web socket is unaware of that port. This causes the webpack-dev-server client code to attempt to connect to the wrong port when a bundle is loaded cross origin.
https://github.com/joeldenning/wds-port-bug
Expected Behavior
webpack-dev-server client code should set up the web socket connection on the port found by webpack-dev-server's findPort function.
Actual Behavior
webpack-dev-server client code defaults to establishing a web socket connection on the port of the origin server, instead of the port of the webpack-dev-server.
Note that in webpack-dev-server@3, this worked.
For Bugs; How can we reproduce the behavior?
https://github.com/joeldenning/wds-port-bug