fix: show error details in preview environments by ZeroPointSix · Pull Request #8752 · nodejs/nodejs.org

Pull request overview

Updates the localized Next.js App Router error page to optionally reveal underlying error information in non-production contexts, addressing missing diagnostics in Vercel Preview and local development (Fixes #7464).

Changes:

  • Add a SHOW_ERROR_DETAILS environment-derived flag to gate error detail rendering.
  • Render error message and digest in a <details> block on the localized 500 error page when the flag is enabled.
  • Add a unit test to cover the “details visible” rendering path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
apps/site/tests/errorPage.test.jsx Adds a unit test asserting that technical details render when SHOW_ERROR_DETAILS is enabled.
apps/site/next.constants.mjs Introduces SHOW_ERROR_DETAILS based on NODE_ENV and VERCEL_ENV.
apps/site/app/[locale]/error.tsx Shows error message/digest in preview/dev via a gated <details> section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.