UNPKG

next-zombie

Version:

Fix ENOENT _buildManifest.js.tmp error. Auto-restart Next.js Turbopack dev server on crash. Supports Next.js 13.4+.

65 lines (44 loc) 1.67 kB
# next-zombie > Auto-recovery CLI for Next.js dev server crashes ## What is this? next-zombie is a CLI wrapper for Next.js development that automatically detects and recovers from Turbopack cache corruption errors. When Next.js crashes due to `_buildManifest.js.tmp` ENOENT errors or other `.next` cache issues, next-zombie clears the cache and restarts the server automatically. ## Quick Start ```bash npx next-zombie ``` ## Key Features - **Auto-Recovery**: Detects cache errors in stdout/stderr and restarts in ~700ms - **Cache Cleanup**: Automatically clears `.next` directory before restart - **PM Detection**: Detects package manager (npm/pnpm/yarn/bun) from lockfile - **Cross-Platform**: Works on macOS, Linux, and Windows (uses tree-kill) - **Desktop Notifications**: Get notified when server restarts - **Session Stats**: Shows restart count and uptime on exit ## Usage ```bash # Default: runs 'dev' script next-zombie # Custom script next-zombie start # With arguments next-zombie dev --port 3001 ``` ## Detected Error Patterns (Turbopack internal errors only) Cache temp files: - `/_buildManifest\.js\.tmp/` - `/build-manifest\.json\.tmp/` - `/_devMiddlewareManifest/` Turbopack panics: - `/FATAL: An unexpected Turbopack error occurred/` - `/thread caused non-unwinding panic/` - `/panicked at.*turbopack/i` Cache directory ENOENT: - `/ENOENT:.*\.next[\\/]static[\\/]development/` - `/ENOENT:.*\.next[\\/]cache/` Windows EPERM: - `/EPERM:.*\.next.*\.tmp/` ## Requirements - Node.js >= 18.0.0 - Next.js project with a `dev` script ## Links - npm: https://www.npmjs.com/package/next-zombie - GitHub: https://github.com/relkimm/next-zombie