#4878 Wrangler hangs on exit after Workers runtime fails to start
Pages-specific: initial runtime failure prevents clean shutdown. Maintainer confirmed.
Fix Pages error handling for initial runtime failures
Analysis Report
Issue Review: cloudflare/workers-sdk#4878
Summary
Wrangler hangs on exit (x or Ctrl+C) after the Workers runtime fails to start.
Findings
- Created: 2024-01-30
- Updated: 2025-10-30
- Version: wrangler 3.25.0 → 4.61.0
- Component: wrangler, pages
- Labels: bug, pages
- Comments: 4
Key Evidence
- Reproduction: Add top-level
crypto.getRandomValues()call (causes runtime error) and runwrangler pages dev - After runtime fails, pressing
xor Ctrl+C shows "Shutting down local server..." but hangs forever - Maintainer @petebacondarwin confirmed reproduction
- Does NOT hang with regular
wrangler dev- only with Pages wrapper - Does NOT hang if runtime fails AFTER first successful build
- Affects users with various runtime errors (e.g., itty-router v5 migration)
- August 2024: User still experiencing this issue
Recommendation
Status: KEEP OPEN
Reasoning: Valid bug affecting Pages dev workflow. Confirmed by maintainer. The bug is specific to wrangler pages dev when the initial runtime fails. Users have to manually find and kill the process. Almost 2 years old with maintainer confirmation but no fix.
Action: Investigate the Pages-specific error handling in wrangler pages dev that prevents clean shutdown when runtime fails on first build.
Suggested Comment
This issue remains valid - the Pages-specific wrapper around dev server doesn't handle initial runtime failures cleanly. Workaround: Use
lsof -i :8788 | grep LISTEN | awk '{print $2}' | xargs killto clean up the hung process.
Notes & Feedback (0)
No notes yet.