Closed LonJonn closed 1 year ago
Was the sample app broken on '/ssr/test3' or '/ssr/test4'? If so, I think it would be related to "unhandled rejection" option of node 15 or later.
In my case, the process was killed by unhandled rejection caused in getServerSideProps.
I posted a preview deployment of the sample app and both /ssr/test3 and /ssr/test4 are broken. Regardless of config, the fact that the official with-sentry example breaks using the deploy on Vercel button means something is wrong.
Oh, yeah. There are some error throwing during build time. (pages/api/test1.js, pages/api/test2.js)
We have to fix them first to build the sample app.
Although after fixing them, however, the sample app is broken on '/ssr/test3' and '/ssr/test4'.
repro: https://github.com/JanKaifer/next-repro-37418.git deployed: https://37418.vercel.app/
It works now.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
Using
getInitialProps
withinpages/_error
causes Vercel serverless functions to crash and not display the_error
component. This doesn't happen locally when usingnext build && next start
, but only when deployed to Vercel.This issue seems to have been brought up last year but nothing has been done about it.
Creating a
500.tsx
page prevents the ugly crash page from displaying, but then the_error.tsx
page isn't executing, losing the ability to do server-side error logging e.g. with sentry.I've also noticed that exporting
getServerSideProps
within_error
seems to work locally but breaks the same way asgetInitialProps
in production. Not sure what this means re: this issue, but I thought I'd mention it as well.Expected Behavior
getInitialProps
should execute and the custom_error
page should be server rendered and displayed.To Reproduce
This bug occurs with the most basic
create-next-app
setup + following this section of the official docs. It even happens with the with-sentry example (I literally just hit the vercel deploy button in the README.md and it broke, see https://nextjs-sentry-example-one.vercel.app/)Literally clone and deploy the with-sentry example.