rsnext/errors/invalid-getstaticprops-value.mdx
Delba de Oliveira 44d1a1cb15
docs: Migrate error messages to MDX and App Router. (#52038)
This PR is part of a larger effort to migrate error messages to MDX and
use App Router: https://github.com/vercel/front/pull/23459
2023-07-05 06:11:16 -07:00

27 lines
595 B
Text

---
title: 'Invalid `getStaticProps` Return Value'
---
## Why This Error Occurred
In one of the page's `getStaticProps` the return value had the incorrect shape.
## Possible Ways to Fix It
Make sure to return the following shape from `getStaticProps`:
```tsx filename="pages/example.tsx"
export async function getStaticProps(ctx: {
params?: ParsedUrlQuery;
preview?: boolean;
previewData?: PreviewData;
}) {
return {
props: { [key: string]: any }
}
}
```
## Useful Links
- [`getStaticProps` Documentation](/docs/pages/api-reference/functions/get-static-props)