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'.
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.
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.
# 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.