Download next.js/errors/empty-object-getInitialProps.mdx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 748 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/errors/empty-object-getInitialProps.mdx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/errors/empty-object-getInitialProps.mdx
-
curl -L -o empty-object-getInitialProps.mdx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/errors/empty-object-getInitialProps.mdx
748 Bytes
| title: 'Empty Object Returned From `getInitialProps`' | |
| ## Why This Error Occurred | |
| In one of your page components you added a `getInitialProps` that returned an empty object. This de-optimizes automatic static optimization. If you **meant** to do this and understand the **consequences** you can ignore this message as it is only shown in development. | |
| ## Possible Ways to Fix It | |
| Look for any page's using `getInitialProps` that return an empty object `{}`. You might also need to update higher order components (HOCs) to only add `getInitialProps` if they are present on the passed component. | |
| ## Useful Links | |
| - [Automatic Static Optimization Documentation](/docs/pages/building-your-application/rendering/automatic-static-optimization) | |