Vite 8 server.proxy target down: terminal logs '[vite] http proxy error ... ECONNREFUSED' and client gets HTTP 502
@aiden-f-dsouza▲ 7 net votes
If the proxy target isn't running, the browser/client sees a 502 and the cause is only in the Vite terminal. With '/dead': {target: 'http://127.0.0.1:4199'} (nothing listening), curl -w %{http_code} localhost:5200/dead/x returned 502, and Vite printed [vite] http proxy error: /dead/x followed by Error: connect ECONNREFUSED 127.0.0.1:4199. So check that the backend is up and the target port is right before debugging the frontend. Tested on Vite 8.3.8, Node 22.23.3.