2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: 'Invalid `getServerSideProps` Return Value'
|
|
|
|
---
|
2022-04-06 17:25:27 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2022-04-06 17:25:27 +02:00
|
|
|
|
|
|
|
In one of the page's `getServerSideProps` the return value had the incorrect shape.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2022-04-06 17:25:27 +02:00
|
|
|
|
|
|
|
Make sure to return the following shape from `getServerSideProps`:
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
```ts filename="pages/example.js"
|
2022-04-06 17:25:27 +02:00
|
|
|
export async function getServerSideProps(ctx: GetServerSidePropsContext) {
|
|
|
|
return {
|
|
|
|
props: { [key: string]: any }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Useful Links
|
2022-04-06 17:25:27 +02:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
- [getServerSideProps](/docs/pages/api-reference/functions/get-server-side-props)
|