[now-next] Provide a better error when failing to load routes-manifest (#4161)

This updates the error message shown when we fail to load the `routes-manifest` which appears to be happening most often when an incorrect output directory is configured for a Next.js application
This commit is contained in:
JJ Kasper
2020-04-27 13:05:03 -05:00
committed by GitHub
parent 23fe8affec
commit 76f61cbbf0
2 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
# Routes Manifest Could Not Be Found
#### Why This Error Occurred
This could be caused by a failure during the build or an incorrect output directory being configured for your Next.js project.
#### Possible Ways to Fix It
Check for any build errors in the logs and ensure that the output directory setting is either not changed or is pointing to the location of the `.next` output folder (`distDir`).
If you are running `next export` you should **not** need to customize the output directory to `out` since the builder automatically detects `next export` being run and uses the output from it.

View File

@@ -340,7 +340,7 @@ export async function getRoutesManifest(
if (shouldHaveManifest && !hasRoutesManifest) {
throw new Error(
`A routes-manifest.json couldn't be found. This could be due to a failure during the build`
`A "routes-manifest.json" couldn't be found. Is the correct output directory configured? This setting does not need to be changed in most cases. More info: https://err.sh/zeit/now/now-next-routes-manifest`
);
}