From 8b1edd9e0d1eaa6aee83142b4ce6cff18923544b Mon Sep 17 00:00:00 2001 From: Faris Masad Date: Tue, 16 Aug 2022 18:36:38 -0700 Subject: [PATCH 1/2] Add note about using the /_error page directly See https://github.com/vercel/next.js/issues/39144 --- docs/advanced-features/custom-error-page.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/advanced-features/custom-error-page.md b/docs/advanced-features/custom-error-page.md index e3f4b2ddf79..ffc93a8da3a 100644 --- a/docs/advanced-features/custom-error-page.md +++ b/docs/advanced-features/custom-error-page.md @@ -98,3 +98,4 @@ If you have a custom `Error` component be sure to import that one instead. `next ### Caveats - `Error` does not currently support Next.js [Data Fetching methods](/docs/basic-features/data-fetching.md) like [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md) or [`getServerSideProps`](/docs/basic-features/data-fetching/get-server-side-props.md). +- `/_error` is a reserved pathname and will render 404 when accessed directly via [routing](/docs/routing/introduction) or rendering in a [custom server](/docs/advanced-features/custom-server). You should create another page if you need. From ef14a0f40124486957c47635d40459fedb33a7dc Mon Sep 17 00:00:00 2001 From: Faris Masad Date: Tue, 16 Aug 2022 19:12:10 -0700 Subject: [PATCH 2/2] Update docs/advanced-features/custom-error-page.md Co-authored-by: Sukka --- docs/advanced-features/custom-error-page.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced-features/custom-error-page.md b/docs/advanced-features/custom-error-page.md index ffc93a8da3a..6b3a2b860b1 100644 --- a/docs/advanced-features/custom-error-page.md +++ b/docs/advanced-features/custom-error-page.md @@ -98,4 +98,4 @@ If you have a custom `Error` component be sure to import that one instead. `next ### Caveats - `Error` does not currently support Next.js [Data Fetching methods](/docs/basic-features/data-fetching.md) like [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md) or [`getServerSideProps`](/docs/basic-features/data-fetching/get-server-side-props.md). -- `/_error` is a reserved pathname and will render 404 when accessed directly via [routing](/docs/routing/introduction) or rendering in a [custom server](/docs/advanced-features/custom-server). You should create another page if you need. +- `_error`, like `_app`, is a reserved pathname. `_error` is used to define the customized layouts and behaviors of the error pages. `/_error` will render 404 when accessed directly via [routing](/docs/routing/introduction) or rendering in a [custom server](/docs/advanced-features/custom-server).