Update Advanced Error Page section in custom-error-page.md #32873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Update More Advanced Error Page Customizing section in custom-error-page.md, by using
getServerSideProps
instead ofgetInitialProps
.Tested locally in my own project and seems to be working as expected. However, on the same docs page there is an example that is using
getServerSideProps
for the page where theError
component is being used so i'm wondering: is there a reason why the example of the customError
page isn't usinggetServerSideProps
? I was thinking that it maybe had the same constraint as the customDocument
&App
pages, where Next.js Data Fetching methods likegetServerSideProps
are not supported.If there are no constraints, this update seems good to me, because it aligns with the latest practices of Next.js. Otherwise maybe a good idea to add the same line as https://nextjs.org/docs/advanced-features/custom-app#caveats where it says that those data fetching methods are not supported.
Documentation / Examples
yarn lint