-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(vite): Hide API proxy error on start #8705
Conversation
Timeout to the rescue! This is much more elegant than what I was thinking, I had no idea about this |
Me neither, till I started looking into it! |
Thanks for this -- I noticed when using vite as well that the web side starts faster now :) |
@cannikin would you please give it a once over? I think DP is busy. |
I noticed that on Gitpod this fix basically has no effect since it takes so long for GitPod to start going: ![]() But that's the downside to a |
What does it do?
It will swallow
ECONNREFUSED
errors for the first 2.5s after launch, and replace it with "⌛ API Server launching, please refresh your page..."Why can't you just remove the error?
Not an option, see vite code: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/proxy.ts#L53
Not an ideal solution - if someone else has a better solution, happy to close this PR.
This is what it looks like:

And in the browser displays this message as before:
