This error is often caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
In the Vercel dashboard, open your "Project Settings" and draw attention to "Build & Development Settings":
- Ensure that the "Build Command" setting is not overridden, or that it calls
next build
. If this command is not overridden but you are seeing this error, double check that yourbuild
script inpackage.json
callsnext build
. IfbuildCommand
exists invercel.json
, make sure it callsnext build
. - Ensure that the "Output Directory" setting is not overridden. This value almost never needs to be configured, and is only necessary if you override
distDir
innext.config.js
. IfoutputDirectory
exists invercel.json
, remove that property. - For
next export
users: do not override the "Output Directory", even if you customized thenext export
output directory. It will automatically detects the correct output.
In rare scenarios, this error message can also be caused by a Next.js build failure (if your "Build Command" accidentally returns an exit code that is not 0). Double check for any error messages above the Routes Manifest error, which may provide additional details.