Skip to content

fix: ignore temp files in Vite watcher to prevent dev server crash#3763

Merged
bartlomieju merged 2 commits intomainfrom
fix/dev-server-tmp-file-crash
Apr 9, 2026
Merged

fix: ignore temp files in Vite watcher to prevent dev server crash#3763
bartlomieju merged 2 commits intomainfrom
fix/dev-server-tmp-file-crash

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Adds default server.watch.ignored patterns to the Fresh Vite plugin config
  • Ignores *.tmp.*, *.timestamp-*, editor swap files (*.swp, *.swo, *~, .#*)
  • Prevents a watchFs race condition on Linux where Deno tries to open a short-lived file that was already deleted, crashing the dev server with NotFound: No such file or directory

Users can still override or extend these patterns in their own vite.config.ts since Vite merges config from plugins.

Closes #3585

Test plan

  • On Linux: start dev server, edit files rapidly with an editor that creates .tmp files — server should not crash
  • Verify Vite's config merging allows users to add additional ignore patterns

🤖 Generated with Claude Code

bartlomieju and others added 2 commits April 9, 2026 12:22
…3585)

On Linux, short-lived files (.tmp, .timestamp-*, editor swap files)
can trigger a watchFs race condition in Deno where the watcher tries
to open a file that was already deleted, crashing the dev server with
ENOENT. Adding these patterns to the default watcher ignore list
prevents the crash.

Closes #3585

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bartlomieju bartlomieju merged commit f39a198 into main Apr 9, 2026
9 checks passed
@bartlomieju bartlomieju deleted the fix/dev-server-tmp-file-crash branch April 9, 2026 11:14
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

Successfully merging this pull request may close these issues.

Dev server crashes due to tmp and timestamp files

1 participant