Fix ENOENT _buildManifest.js.tmp error. Auto-restart Next.js Turbopack dev server on crash. Supports Next.js 13.4+.
npm install next-zombie> Fix "ENOENT _buildManifest.js.tmp" error automatically
>
> Turbopack crash recovery | Auto-restart for Next.js 13.4+




Turbopack is fast. But it crashes. Cache corruption, _buildManifest.js.tmp errors, random ENOENT failures ā sound familiar?
next-zombie watches your Next.js dev server and automatically restarts it when Turbopack crashes. No more manual restarts. No more rm -rf .next. Just keep coding.
Works with Next.js 13.4+ using Turbopack (especially useful in 15+ where Turbopack is default)
Turbopack (Next.js 13.4+) is blazing fast, but unstable:
```
⨯ [Error: ENOENT: no such file or directory, open '.next/static/development/_buildManifest.js.tmp']
When does this happen?
- Next.js 13.4-14.x with --turbo flag
- Next.js 15+ (Turbopack is default)
- Next.js 16+ (same Turbopack issues)
Your choices:
1. Disable Turbopack ā Stable but slower (next dev --turbo=false)
2. Use next-zombie ā Keep Turbopack speed + auto-recovery
`bash`
npx next-zombie
That's it. Your dev server now auto-recovers from crashes.
`bash`
npm install -D next-zombieor
pnpm add -D next-zombieor
yarn add -D next-zombie
Add to package.json:
`json`
{
"scripts": {
"dev": "next-zombie"
}
}
| Feature | Description |
|---------|-------------|
| Auto-Recovery | Detects crashes and restarts in ~700ms |
| Keyboard Shortcuts | Interactive controls: restart, clear cache, open browser |
| Browser Auto-Refresh | Automatically refreshes browser after restart |
| Auto Install | Fixes missing modules with automatic npm install |
| Port Conflict Resolution | Automatically finds next available port |
| Cache Cleanup | Clears .next before restart |dev
| Smart PM Detection | Detects npm/pnpm/yarn/bun from lockfile |
| Cross-Platform | Works on macOS, Linux, and Windows |
| Session Report | Detailed stats with error breakdown on exit |
| Zero Config | Works with your existing script |
``
next-zombie
ā
āāāŗ Clean .next cache
ā
āāāŗ Start: pnpm run dev
ā
āāāŗ Monitor stdout/stderr
ā ā
ā āāāŗ Cache error detected?
ā ā ā
ā ā āāāŗ Kill process tree
ā ā āāāŗ Restart (after 500ms)
ā ā
ā āāāŗ Process crashed?
ā ā
ā āāāŗ Restart (after 200ms)
ā
āāāŗ Ctrl+C ā Clean exit
next-zombie runs in interactive mode with keyboard controls:
``
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā š§ next-zombie v1.8.0 ā
ā Press: r=restart c=clear o=open h=help q=quit ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| Key | Action |
|-----|--------|
| r | Restart dev server manually |c
| | Clear .next cache (without restart) |o
| | Open browser (localhost:PORT) |h
| | Show keyboard shortcuts help |q
| | Quit |Enter
| | Add blank line (for log separation) |
> Note: Keyboard shortcuts are disabled in non-TTY environments (CI, pipes).
next-zombie auto-restarts on Turbopack internal errors only (not user code errors):
Cache temp file corruption:
- _buildManifest.js.tmp ENOENTbuild-manifest.json.tmp
- EPERM_devMiddlewareManifest
- errors
Turbopack panics:
- FATAL: An unexpected Turbopack error occurredpanicked at turbopack/...
- Rust panic messages ()
Cache directory errors:
- .next/static/development/ ENOENT.next/cache/
- ENOENT.tmp
- Windows EPERM on files
NOT restarted (user code errors):
- SyntaxError, TypeError, ReferenceErrorModule not found
- errors
- API/runtime errors
When port 3000 (or any port) is already in use, next-zombie automatically tries the next port:
`
Error: listen EADDRINUSE: address already in use :::3000
[next-zombie] Port 3000 in use
[next-zombie] Trying port 3001...
[next-zombie] Starting Next.js dev server on port 3001...
`
No more manually killing processes or adding --port flags!
After a restart, your browser automatically refreshes when the server is ready. No setup needed!
``
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā š§ next-zombie v1.8.0 ā
ā Proxy ready on http://localhost:3000 ā
ā Auto-refresh enabled (no setup needed!) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
How it works:
- next-zombie runs a proxy server on port 3000
- Next.js runs internally on port 3001
- The proxy automatically injects auto-refresh script into HTML
- When server restarts ā browser refreshes automatically!
Just open http://localhost:3000 and you're done. Press o to open browser.
Missing a module? next-zombie automatically runs npm install and restarts:
`
Module not found: Can't resolve 'lodash'
[next-zombie] Missing module: lodash
[next-zombie] Running npm install...
[next-zombie] Install completed
[next-zombie] Restarting...
`
This catches:
- Cannot find module 'xxx'Module not found: Can't resolve 'xxx'
- Cannot find package 'xxx'
-
To disable: next-zombie --no-auto-install
`bashDefault: runs 'dev' script
next-zombie
Options
| Option | Description |
|--------|-------------|
|
--no-clear | Don't clear .next cache on restart |
| --no-refresh | Disable auto browser refresh |
| --no-auto-install | Disable auto npm install on module errors |
| -h, --help | Show help message |
| -V, --version | Show version number |Package Manager Detection
next-zombie detects your package manager automatically:
1. Lockfile (priority):
pnpm-lock.yaml ā pnpm
2. Fallback: How you ran it (npx ā npm)So even with
npx next-zombie, it runs pnpm run dev if you have pnpm-lock.yaml.Session Report
On exit (Ctrl+C), next-zombie shows a detailed session report:
`
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā š Session Report ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Uptime: 2h 15m ā
ā Restarts: 7 ā
ā Avg interval: 19m ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Errors: ā
ā ⢠buildManifest.tmp (5x) ā
ā ⢠FATAL Turbopack (2x) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāš” Tip: Frequent crashes may indicate Turbopack instability.
Try: next dev --turbo=false (use Webpack instead)
`The report includes:
- Total uptime and restart count
- Average time between crashes
- Error breakdown by type (top 5)
- Helpful tips based on error patterns
Requirements
- Node.js >= 18.0.0
- Next.js project
Contributing
Found a new error pattern that should trigger auto-restart? Open an issue!
FAQ
Q: Which Next.js versions are supported?
Next.js 13.4+ with Turbopack enabled. This includes:
- 13.4-14.x: When using
next dev --turbo
- 15.x+: Turbopack is default (most useful here)
- 16.x+: Same Turbopack issues, same solutionIf you're not using Turbopack (
--turbo=false), you don't need this tool.Q: Does this fix the Turbopack bugs?
No. It's a workaround. When Turbopack crashes, next-zombie restarts your server automatically so you don't have to.
Q: Should I use this in production?
No. This is for development only. Production builds (
next build`) don't have this issue.Q: Why not just disable Turbopack?
You can! But Turbopack is significantly faster. next-zombie lets you keep that speed while handling the occasional crash.
MIT Ā© relkimm