#6562 shutting down dev server logs errors in console
Race condition: temp files deleted before miniflare/esbuild finishes. Now also affects live file changes.
Investigate cleanup ordering; ensure miniflare shuts down before temp deletion
Analysis Report
Issue Review: cloudflare/workers-sdk#6562
Summary
Shutting down wrangler dev server logs ENOENT errors in console when temp files are deleted before miniflare/esbuild finishes using them.
Findings
- Created: 2024-08-22
- Updated: 2025-10-30
- Version: wrangler 3.72.2 → 4.61.0
- Component: wrangler
- Labels: bug
- Comments: 7
Key Evidence
- Error appears occasionally when shutting down dev server (via
xhotkey or Ctrl+C) - Reporter @threepointone (Cloudflare employee) suspects race condition: miniflare/esbuild stays alive after temp directory deleted
- Error also appears in CI runs
- Dec 2024 update: Similar error now happens during local dev on file changes, breaking the dev server for future requests
- No log file path shown with more info
- Added to backlog per @lrapoport-cf comment (Nov 2024)
Recommendation
Status: KEEP OPEN
Reasoning: Valid race condition bug affecting dev server stability. The Dec 2024 update indicates the problem has worsened - now affects live file changes, not just shutdown. This breaks the development workflow. Filed by Cloudflare employee who can reproduce consistently.
Action: Investigate the cleanup ordering during shutdown and file changes. Ensure miniflare/esbuild fully shuts down before temp directories are deleted.
Suggested Comment
N/A - Already acknowledged and added to backlog by maintainer.
Notes & Feedback (0)
No notes yet.