Skip to content

Vite tries to reconnect to websocket every second #5228

@milosivanovic

Description

@milosivanovic

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Discussing

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions