1

My project is using

  • Vuejs (ver 2.6.14) (vue-cli uses Webpack5)
  • Docker (nginx for proxy) => localhost:3000 -> localhost:4000

When using vue version 2.5.~, I set devServer.public is 'localhost:4000' in vue.config.js and HMR works good. But after upgrading to 2.6.14 (using webpack4 into webpack5), HMR never works.

I change 'devServer.public' to 'devServer.client.webSocketURL' in 'vue.config.js'. Detail is as follow. enter image description here

And build result. enter image description here

Here is a error that is WebSocket connection to 'ws://localhost:4000/ws' failed: enter image description here

How can I this problem..? please do me a favor...

  • Disappearing 'WebSocket connection to 'ws://localhost:4000/ws' failed:'.

  • Working correctly HMR.

And I wonder why that problem happened.

Mitchell
  • 11
  • 1
  • change `auto://localhost:4000/ws` to `http://localhost:4000/ws` – Para Feb 24 '23 at 08:12
  • [Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551) If you're having trouble running Webpack on host code from an isolated Docker environment, would it work better to take the isolation system out of the picture and run Node directly on the host? – David Maze Feb 24 '23 at 11:29

0 Answers0