Next.js ENOENT .next/build-manifest - Fix in CI
Next looked for .next/build-manifest.json and it is not there. A start/export step ran before next build, or a cache step restored a partial .next.
What this error means
A next start, export, or post-build step fails with ENOENT: no such file or directory, open '.next/build-manifest.json'.
next
Error: ENOENT: no such file or directory, open
'/app/.next/build-manifest.json'
at Object.openSync (node:fs:600:3)Common causes
Build step skipped or failed silently
next start/export ran without a successful next build first, so .next is missing or incomplete.
Partial .next cache restored
A CI cache restored a stale or incomplete .next directory missing the manifest.
How to fix it
Build before start/export
- Ensure next build runs and succeeds before any step that reads .next.
Terminal
npm run build && npm run startStop caching the full .next output
- Cache only the Next build cache, not the whole .next, or clean before building.
Terminal
# cache key for .next/cache only; rebuild .next fresh each run
rm -rf .next && npm run buildHow to prevent it
- Fail the pipeline if
next builddoes not exit zero before downstream steps. - Cache
.next/cacheonly, never the full.nextartifact.
Related guides
Next.js "Module not found: Can't resolve" - Fix in CIFix "Module not found: Can't resolve" during next build in CI - a missing dependency, a wrong tsconfig path a…
Next.js "Export encountered errors" - Fix in CIFix "Export encountered errors on following paths" in CI - a page threw during static export, often from runt…
Next.js Build Out of Memory - Fix in CIFix "JavaScript heap out of memory" during next build in CI - a large app exceeds the Node heap on a small ru…