Fix server-side error message leaking to browser in production

error.message was displayed to users in all environments, while
stack traces were correctly gated behind import.meta.env.DEV.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-05 10:25:07 -05:00
parent 41ed815a19
commit f8d96cb7ae

View file

@ -72,8 +72,8 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
message = error.statusText || message;
}
} else if (error instanceof Error) {
message = error.message;
if (import.meta.env.DEV) {
message = error.message;
stack = error.stack;
}
}