Unverified Commit db445db7 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add err.sh for invalid getStaticPaths return value (#10605)

* Add err.sh for invalid getStaticPaths return value

* Update error link

* Apply suggestions from code review
Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
parent 61025b86
# 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<string | { params: { [key: string]: string } }>
}
}
```
......@@ -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 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment