Overview
src/components/errors/ErrorBoundarySystem.tsx passes showDetails={true} unconditionally to UserFriendlyErrorDisplay. In a production deployment, this renders full stack traces and internal error messages to end users, leaking implementation details and potentially sensitive server paths or data structures.
Specifications
Features:
- Stack traces are only displayed in development and staging environments
- Production error UI shows a generic user-friendly message only
Tasks:
- Replace the hardcoded
showDetails={true} with showDetails={process.env.NODE_ENV === 'development'}
- Add an optional
showDetails prop to ErrorBoundarySystem so callers can override for staging
- Verify
global-error.tsx applies the same guard
- Add a unit test asserting the stack trace element is absent in the production render
Impacted Files:
src/components/errors/ErrorBoundarySystem.tsx
src/app/error.tsx
src/app/global-error.tsx
Acceptance Criteria
- Stack traces are not visible in the rendered HTML when
NODE_ENV=production
showDetails defaults to false unless explicitly enabled
- Existing error boundary tests still pass
Overview
src/components/errors/ErrorBoundarySystem.tsxpassesshowDetails={true}unconditionally toUserFriendlyErrorDisplay. In a production deployment, this renders full stack traces and internal error messages to end users, leaking implementation details and potentially sensitive server paths or data structures.Specifications
Features:
Tasks:
showDetails={true}withshowDetails={process.env.NODE_ENV === 'development'}showDetailsprop toErrorBoundarySystemso callers can override for stagingglobal-error.tsxapplies the same guardImpacted Files:
src/components/errors/ErrorBoundarySystem.tsxsrc/app/error.tsxsrc/app/global-error.tsxAcceptance Criteria
NODE_ENV=productionshowDetailsdefaults tofalseunless explicitly enabled