From 964e4419141eaf6675ec4f305733cf0b05870f36 Mon Sep 17 00:00:00 2001 From: glenngijsberts Date: Mon, 10 Jan 2022 22:14:48 +0100 Subject: [PATCH] Add Caveats section to custom error page This is a follow up of https://github.com/vercel/next.js/pull/32873. As discussed in #32873, currently it's not recommended to use getServerSideProps in the `Error` component, so this commit will add that caveat to the page, like `Document` and `App` also have. --- docs/advanced-features/custom-error-page.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/advanced-features/custom-error-page.md b/docs/advanced-features/custom-error-page.md index 6dfa999892be1..40913ed76eee1 100644 --- a/docs/advanced-features/custom-error-page.md +++ b/docs/advanced-features/custom-error-page.md @@ -94,3 +94,7 @@ export default function Page({ errorCode, stars }) { The `Error` component also takes `title` as a property if you want to pass in a text message along with a `statusCode`. If you have a custom `Error` component be sure to import that one instead. `next/error` exports the default component used by Next.js. + +### Caveats + +- `Error` currently does not support Next.js [Data Fetching methods](/docs/basic-features/data-fetching.md) like [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) or [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering).