Replies: 2 comments
-
I just ran into this, having to wrap getServerSideProps, it's a pain to maintain! |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'd like a flag or some easier way to develop error pages as well, currently it's pretty hard to do as you have to do a production build to test out the error pages. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature you'd like to request
Currently a custom error page is only rendered in production if an error occurs on the server (e.g.
getServerSideProps
).This is documented behavior but makes development on these pages in my opinion needlessly hard. Especially for internal services we want to display rich error information on the frontend instead of having to go into backend logs.
I view this custom error page similar to an error boundary and therefore it wouldn't make sense to only render it in production. Client-side errors trigger error boundaries regardless of dev or prod. The error overlay is simply an addition during development but does not replace the error boundary.
Describe the solution you'd like
Render
pages/_error
regardless of dev or prod. The error overlay is a dev addition just like client-side errors are handled.Describe alternatives you've considered
We currently have to wrap every
getServerSideProps
in a try-catch that renders our error boundary explicitly instead of relying on NextJS renderingpages/_error.js
. This adds another layer of indirection and requires manual review of new pages.Beta Was this translation helpful? Give feedback.
All reactions