2020-02-27 18:57:39 +01:00
|
|
|
# Invalid getStaticProps Return Value
|
2020-02-21 06:45:50 +01:00
|
|
|
|
|
|
|
#### Why This Error Occurred
|
|
|
|
|
2020-02-27 18:57:39 +01:00
|
|
|
In one of the page's `getStaticProps` the return value had the incorrect shape.
|
2020-02-21 06:45:50 +01:00
|
|
|
|
|
|
|
#### Possible Ways to Fix It
|
|
|
|
|
2020-02-27 18:57:39 +01:00
|
|
|
Make sure to return the following shape from `getStaticProps`:
|
2020-02-21 06:45:50 +01:00
|
|
|
|
|
|
|
```js
|
2020-03-01 15:20:28 +01:00
|
|
|
export async function getStaticProps(ctx: {
|
|
|
|
params?: ParsedUrlQuery
|
|
|
|
preview?: boolean
|
|
|
|
previewData?: any
|
|
|
|
}) {
|
2020-02-21 06:45:50 +01:00
|
|
|
return {
|
|
|
|
props: { [key: string]: any }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|