rsnext/errors/invalid-getstaticprops-value.md
Samuel 739e6f0760
Docs: Add useful link to invalid-getstaticprops-value error message (#35915)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

I would like to add useful link to `getStaticProps` invalid return value error message as currently there is no useful link being provided. I believe that this might improve the developer experience.
2022-04-05 18:59:58 +00:00

569 B

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:

export async function getStaticProps(ctx: {
    params?: ParsedUrlQuery;
    preview?: boolean;
    previewData?: PreviewData;
}) {
    return {
        props: { [key: string]: any }
    }
}