diff --git a/errors/invalid-getstaticpaths-value.md b/errors/invalid-getstaticpaths-value.md new file mode 100644 index 000000000000000..7f5412b2ff4d82e --- /dev/null +++ b/errors/invalid-getstaticpaths-value.md @@ -0,0 +1,18 @@ +# Invalid unstable_getStaticPaths Return Value + +#### Why This Error Occurred + +In one of the page's `unstable_getStaticPaths` the return value had the incorrect shape. + +#### Possible Ways to Fix It + +Make sure to return the following shape from `unstable_getStaticPaths`: + +```js +export async function unstable_getStaticProps() { + return { + paths: Array + } +} +``` + diff --git a/packages/next/build/utils.ts b/packages/next/build/utils.ts index 8d6aeeb096d3376..88ab4890ae34e99 100644 --- a/packages/next/build/utils.ts +++ b/packages/next/build/utils.ts @@ -562,7 +562,9 @@ export async function isPageStatic( const staticPathsResult = await (mod.unstable_getStaticPaths as Unstable_getStaticPaths)() - const expectedReturnVal = `Expected: { paths: [] }` + const expectedReturnVal = + `Expected: { paths: [] }\n` + + `See here for more info: https://err.sh/zeit/next.js/invalid-getstaticpaths-value` if ( !staticPathsResult ||