next.js/errors/invalid-getstaticprops-value.mdx
invalid-getstaticprops-value.mdx28 lines595 B
---
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)
Quest for Codev2.0.0
/
SIGN IN