I have created a custom 500.tsx page under the pages folder. But still, I am unable to get my 500 page working, instead, it shows the default error message.

enter image description here

I have tried deleting my custom 500 pages so that Nextjs _error.tsx works, but the behavior is still the same, it shows the default error message.

am I missing anything?

1 Answer 1


Next.js apps support custom error pages. The JSS Next.js sample app includes custom error page implementations for errors with the status codes 404 and 500.

The sample JSS Next.js app provides a custom 500 page, defined in the file src/pages/_error.tsx.

Next.js handles 500 errors client-side and server-side. The 500 error page is rendered for all errors except 404 in production. In development, the application renders the error with the call stack.

Try to run an application in production mode. You can check the package.json for the command next build.

Refer to the below links for more details.

Hope it helps!

  • Sumit, Thanks for the answer all things are in place I have already followed the steps that are mentioned in your answer, but still the same issue
    – Manoj
    Commented Nov 20, 2023 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.