Skip to content
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

Vite tries to reconnect to websocket every second #5228

Closed
4 tasks done
milosivanovic opened this issue Oct 8, 2021 · 3 comments · Fixed by #12698
Closed
4 tasks done

Vite tries to reconnect to websocket every second #5228

milosivanovic opened this issue Oct 8, 2021 · 3 comments · Fixed by #12698

Comments

@milosivanovic
Copy link

Clear and concise description of the problem

This was reported earlier as #1989 by @ikmrgrv but dismissed:
Screen Shot 2021-10-07 at 11 44 06 PM

This kind of cleverness causes memory bloat in browsers for users that choose to keep the tab open after CTRL+Cing the server without intention to immediately continue development, since it accumulates tens of thousands of errors with no way to disable, in addition to being a general waste of cycles.

More annoyingly, when starting rails server, which also uses port 3000, I get an unwelcome request to my rails server if I had vite running earlier: /__vite_ping, and the page suddenly refreshes and displays something completely different.

Hot reload and HMR are great, but we don't have to go so far as to completely control the browser for the user like this.

Suggested solution

Please make this configurable. Ideally, this should be disabled by default. Users know to load the page when they start a server. Reloading blindly after a server was shutdown is going too far in my opinion.

Alternative

No response

Additional context

No response

Validations

@vhscom
Copy link

vhscom commented Mar 24, 2022

I just started noticing this today as I've been connecting and disconnecting frequently. However, I think the issue may be more of a workflow-related matter as one can Ctrl+Z to suspend Vite and send it into the background and no polling errors occur during that time.

@dd-web
Copy link

dd-web commented Aug 28, 2022

Is there any solution to this? I run laravel through homestead on virtualbox, for front end development I'll run vite on my local (windows) env on pwsh and no matter how I configure the server.host or server configuration options I will receive a never ending stream of 404 vite pings in my console.

I noticed vite doesn't care what I give it for server options, it will always use whatever host I connect to which isn't what I want. is there any way I can change this? or am I misunderstanding the server options?

@bluwy bluwy added this to Team Board Sep 4, 2022
@bluwy bluwy moved this to Discussing in Team Board Sep 4, 2022
@randName
Copy link

would what I mentioned in #4411 help?

@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.