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's development server misbehaves when run under Deno version 2.1.2 and later #27558

Open
GunnerGuyven opened this issue Jan 5, 2025 · 0 comments

Comments

@GunnerGuyven
Copy link

GunnerGuyven commented Jan 5, 2025

Version: Deno 2.1.2, 2.1.3, 2.1.4
OS: Arch Linux

When Vite's development server is running under Deno and a file it is tracking is modified by Neovim, a change is registered in every file that Vite is tracking and all are reloaded.

Because of this HMR is unusable. Vite will inevitably detect too many changes and overwhelm the refresh system leading to either a crash and relaunch or at best a total source reload.

This only happens under Deno after version 2.1.2, earlier versions do not exhibit this issue.

Some editors other than Neovim also do not trigger this issue (for instance a filesave in VSCode does not cause this to happen). There seems to be something specific about the way Neovim saves a file that confuses Vite's file watcher when run under Deno 2.1.2 and later.

I have tested many versions of Neovim (v9.x, v10.x, nightly) with and without plugins enabled, and all trigger this issue. Many versions of Vite (v4.x, v5.x, v6.x) as well, and all trigger this issue.

The problem has specifically been observed in Neovim (any version), Vite (any version), and Deno (2.1.2, 2.1.3, and 2.1.4)

Here is a simple reproduction of the issue https://github.com/GunnerGuyven/deno-issue-example-1

Downgrading Deno using sudo deno upgrade 2.1.1 also avoids this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant