/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/invalid-getstaticprops-value.mdx
27 строк
595 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- 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)