vercel/next.js · critical
Manifest file is empty
Error message
Manifest file is empty
What it means
Thrown by evalManifest when a manifest file read from the build output exists but has zero bytes (content.length === 0). Manifests are generated during build; an empty one means the build artifact is corrupt, truncated, or was wiped mid-write.
Source
Thrown at packages/next/src/server/load-manifest.external.ts:118
if (shouldCache && cache.has(path)) {
return cache.get(path) as T
}
let content: any
if (handleMissing) {
try {
content = readFileSync(/* turbopackIgnore: true */ path, 'utf8')
} catch (err) {
let result = undefined
cache.set(path, result)
return result
}
} else {
content = readFileSync(/* turbopackIgnore: true */ path, 'utf8')
}
if (content.length === 0) {
throw new Error('Manifest file is empty')
}
let contextObject = {
process: { env: { NEXT_DEPLOYMENT_ID: process.env.NEXT_DEPLOYMENT_ID } },
}
runInNewContext(content, contextObject)
// Freeze the context object so it cannot be modified if we're caching it.
if (shouldCache) {
contextObject = deepFreeze(contextObject)
}
if (shouldCache) {
cache.set(path, contextObject)
}
return contextObject as T
}View on GitHub (pinned to 0ae8c72462)
Solutions
- Re-run `next build` cleanly to regenerate all manifests.
- Delete the distDir (.next) entirely before rebuilding to remove any corrupt/empty files.
- Ensure the build completes without being killed (check CI timeouts / OOM kills).
- Verify the deployed .next directory is complete and not truncated during copy.
Example fix
# before: corrupt/empty manifest from an interrupted build rm -rf .next && next build # rebuild was interrupted # after: clean and complete rebuild rm -rf .next && next build && next start
Defensive patterns
Strategy: validation
Validate before calling
import fs from 'fs'
function assertManifestValid(path: string): void {
const stat = fs.statSync(path)
if (stat.size === 0) throw new Error(`Manifest ${path} is empty; rebuild`)
} Type guard
import fs from 'fs'
function isManifestNonEmpty(path: string): boolean {
return fs.existsSync(path) && fs.statSync(path).size > 0
} Try / catch
null
Prevention
- Delete distDir before building to avoid stale/empty files.
- Ensure builds complete (watch for OOM/timeout kills).
- Verify deployed .next is complete and not truncated.
When it happens
Trigger: The server tries to load a manifest (e.g. routes-manifest, _buildManifest, react-loadable-manifest) from distDir and the file is present but 0 bytes. readFileSync succeeds but returns an empty string.
Common situations: A build was interrupted/killed leaving a partially written manifest, a deploy that copied an incomplete .next, concurrent processes writing to the same distDir, or disk full during build.
Related errors
- Failed to deploy project ${linkRes.stdout} ${linkRes.stderr}
- Invalid fallback option: ${fallbackField}. Fallback option m
- Could not find a production build in the '${opts.config.dist
- Could not find a production build in the '${this.distDir}' d
- Command failed: ${command} ${args.join(' ')} (exit ${code})
AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06).
Data as JSON: /api/errors/a5e86f847c7eb28c.
Report an issue: GitHub.