Webpack-dev-server: devServer.sockPath

Created on 24 Apr 2020  Â·  7Comments  Â·  Source: webpack/webpack-dev-server


Bug report




What is the current behavior?

  1. Using "devserver.sockPath" will make hot updates cross domain.
  2. Devserver.sockPath does not work.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Use nginx to proxy the local service. The local service uses domain name access. If you do not use "devserver.sockPath", there will be no cross domain problem. If you use it, there will be cross domain problem.
  2. Devserver.sockPath itself is not working.






What is the expected behavior?

  1. Correct hot update with devserver.sockPath.
  2. Devserver.sockPath works normally.


Other relevant information:
webpack version: 4.43.0
Node.js version: 12.16.1
Operating System: win10
Additional tools: nginx, yarn

Most helpful comment

@jiankafei @evilebottnawi I have the same issue and despite having devServer.sockPath: '/app/sockjs-node' I get in Chrome Inspector first...

sockjs.js:1606 GET http://mydevserver.com:8999/sockjs-node/info?t=1600683780379 404 (Not Found)

...then a few times...

WebSocket connection to 'ws://mydevserver.com:8999/app/sockjs-node/224/cidsxlef/websocket' failed: Invalid frame header
[WDS] Disconnected!

fwiw, I have devServer reverse-proxied via express and http-proxy-middleware.
I tried with both webpack 4.43 and 5.0.0-rc.0

All 7 comments

Please create reproducible test repo

Can't reproduce

Please create reproducible test repo

Wait a moment

Please create reproducible test repo
Use this project to test:
https://github.com/jiankafei/wds-test

@jiankafei Thanks I will look in this in near future

@jiankafei @evilebottnawi I have the same issue and despite having devServer.sockPath: '/app/sockjs-node' I get in Chrome Inspector first...

sockjs.js:1606 GET http://mydevserver.com:8999/sockjs-node/info?t=1600683780379 404 (Not Found)

...then a few times...

WebSocket connection to 'ws://mydevserver.com:8999/app/sockjs-node/224/cidsxlef/websocket' failed: Invalid frame header
[WDS] Disconnected!

fwiw, I have devServer reverse-proxied via express and http-proxy-middleware.
I tried with both webpack 4.43 and 5.0.0-rc.0

Was this page helpful?
0 / 5 - 0 ratings