Next.js Discord

Discord Forum

How can I show the custom error page with Vercel 'Serverless Function timed out' error?

Unanswered
Japanese flying squid posted this in #help-forum
Open in Discord
Japanese flying squidOP
I tried to get help for this on Nextjs' Github repo but nobody answered yet (https://github.com/vercel/next.js/discussions/51629), so I'm reproducing it here:

I can make the custom error pages work for every server-side error except that one from Vercel when the serverless function timed out. Is there a way to make the custom Next.js error page appear when that error happens?

I've set up a simple example where the home page has a time-out inside getServerSideProps, as well as the _error.js and 500.js pages (left both of them as .js for the sake of simplicity). Obviously, I can't reproduce the error locally, but I can't also make the page appear on the deployed version. 🙁

Example: https://github.com/mitestainer/error-500

0 Replies