Error: ENOENT: no such file or directory, open '.next/routes-manifest.json'
Quick answer
This means the app is trying to start (`next start`) before a full `next build` has actually completed and produced a `.next` folder. Confirm your deploy pipeline runs `next build` first, and that no earlier step in the build silently failed before reaching it.
What causes this error
routes-manifest.json is generated by next build inside the .next directory. If next start (or your host's equivalent) runs against a project where the build never finished — or finished with errors that were ignored — this file won't exist, and Next.js fails immediately trying to read it.
The Fix
- Run
npm run buildlocally and check the full output for errors, not just the final lines - Confirm your deployment platform's build command is actually
next build, not a typo or a cached/skipped step - If deploying manually (not via Vercel), make sure the
.nextfolder is actually included in what gets uploaded/copied to the server
Common causes / variations
- A build step that errors out but the CI pipeline doesn't treat it as a failure
- Using
output: 'standalone'innext.config.jswithout copying the required standalone files to the deploy target - Running
next startagainst a completely different directory than where the build actually ran
Related errors
See also: Module not found on Vercel (case sensitivity).
Was this fix helpful?
Comments
Loading comments...