We run webpack through a rails application and a gem called webpacker
We there for run our webserver at one port, but our dev server on another port.
Because the websocket just uses window.localtion.port (https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/master/src/runtime/createSocket.js#L26) it tries to connect to our web server port, not our web socket port.
This could be fixed a few ways.
- You could allow a customer port to be passed to createSocket
- You could use the port that is specified in webpack-dev-server's config
sockPort (https://webpack.js.org/configuration/dev-server/#devserversockport), with a fall back webpack-dev-servers port and finally a fall back to window.localtion.port
This may also solve #36
We run webpack through a rails application and a gem called webpacker
We there for run our webserver at one port, but our dev server on another port.
Because the websocket just uses
window.localtion.port(https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/master/src/runtime/createSocket.js#L26) it tries to connect to our web server port, not our web socket port.This could be fixed a few ways.
sockPort(https://webpack.js.org/configuration/dev-server/#devserversockport), with a fall back webpack-dev-serversportand finally a fall back towindow.localtion.portThis may also solve #36