Vite proxy error ECONNREFUSED does not change the browser request from pending. #7620
-
I have a question about For Create React App's http-proxy-middleware, it returns a 504 error. I would like to resolve this issue in order to change from CRA to Vite. Please reply.
When a proxy error
|
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 30 replies
-
I'm also experiencing this, IMO this is a bug in Vite, or at least surprising behavior. If the proxy request to an upstream server fails, Vite should also return an error response back to the browser, not leave a hanging request. |
Beta Was this translation helpful? Give feedback.
-
Also #8117 |
Beta Was this translation helpful? Give feedback.
-
We might see if this is os related #bump |
Beta Was this translation helpful? Give feedback.
-
It happened to me as well, with Node v18.4.0. I figured it works correctly on Node v16.15.0, so that's the workaround I'm going with until Vite (and/or |
Beta Was this translation helpful? Give feedback.
-
I think #7398 (included in 3.0.0+) fixed this. |
Beta Was this translation helpful? Give feedback.
-
I use vite@2.9.15 |
Beta Was this translation helpful? Give feedback.
-
im having the same issue with node 16.14.2 and vite. I'm using shopify, with npm shopify init@latest and nothing works |
Beta Was this translation helpful? Give feedback.
-
We are also experiencing this issue using Vite 4.2.0 and Node 18.14.2 (LTS). But not on regular requests, but on EventStreams only. When terminating the Express server, the EventStream cuts off when connecting without a proxy. Using the proxy, the Vite console shows a proxy error:
The HTTP Request as seen in the DevTools is not erroring or terminating as it did, when the proxy was not used. |
Beta Was this translation helpful? Give feedback.
-
Node16 worked with 'localhost', switching to Node17+ fails with 'localhost'. Fix
|
Beta Was this translation helpful? Give feedback.
-
This is still broken (at least with |
Beta Was this translation helpful? Give feedback.
-
{
server: {
+ host: '0.0.0.0',
},
} |
Beta Was this translation helpful? Give feedback.
-
Hi folks, is there any other suggestions? I've systematically tried all the options suggested in this thread but the issue still occurs for myself and my team |
Beta Was this translation helpful? Give feedback.
-
This solved it for me. Stack Overflow could of sworn I got this link from this thread but now I don't see it. |
Beta Was this translation helpful? Give feedback.
-
如果代理规则是localhost 请改为 本机地址(127.0.0.1) ,反之相反,亲测有效 |
Beta Was this translation helpful? Give feedback.
-
This should solve the problem for those having issues with the solution working locally but not on VERCEL / NETLIFY If your app is on VERCEL, edit your
If your app is on NETLIFY, edit your
|
Beta Was this translation helpful? Give feedback.
I think #7398 (included in 3.0.0+) fixed this.