mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
7fe9065917
## Summary Change [language and filename](https://nextjs.org/docs/canary/community/contribution-guide#language-and-filename) for match code block language. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: JJ Kasper <jj@jjsweb.site>
24 lines
535 B
Plaintext
24 lines
535 B
Plaintext
---
|
|
title: 'Invalid `getServerSideProps` Return Value'
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
In one of the page's `getServerSideProps` the return value had the incorrect shape.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
Make sure to return the following shape from `getServerSideProps`:
|
|
|
|
```tsx filename="pages/example.tsx"
|
|
export async function getServerSideProps(ctx: GetServerSidePropsContext) {
|
|
return {
|
|
props: { [key: string]: any }
|
|
}
|
|
}
|
|
```
|
|
|
|
## Useful Links
|
|
|
|
- [getServerSideProps](/docs/pages/api-reference/functions/get-server-side-props)
|