Next.js Discord

Discord Forum

Pattern for handling 500 errors on React Server Components

Unanswered
Giant Angora posted this in #help-forum
Open in Discord
Giant AngoraOP
We have a Nextjs App deployed on Vercel.

We created global-error.tsx and error.tsx files. We even have <ErrorBoundary/> component wrapping all the content of the page.

But when something fail inside React Server Component
export default function Page(){
    throw new Error("Something went wrong");
}

well, this will throw the default 500 page of Next.js instead of using the custom one we created on the error files.

What should i do in this case? How can i ensure that Next error files capture errors happens on RSC?

0 Replies