From 1323380b0c4d4b5fd850f751634f1f59783b99b1 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Mon, 8 Apr 2024 14:00:13 +1000 Subject: [PATCH] Fix error sanitization test --- integration/playwright.config.ts | 1 - packages/react-router-dom/index.tsx | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/integration/playwright.config.ts b/integration/playwright.config.ts index 4aa631274d..0e0fbc76fd 100644 --- a/integration/playwright.config.ts +++ b/integration/playwright.config.ts @@ -6,7 +6,6 @@ const config: PlaywrightTestConfig = { testMatch: ["**/*-test.ts"], // TODO: Temporary! Remove from this list as we get each suite passing testIgnore: [ - "**/error-sanitization-test.ts", "**/file-uploads-test.ts", "**/vite-basename-test.ts", "**/vite-build-test.ts", diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 85de0974d9..996a457d18 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -595,9 +595,7 @@ function deserializeErrors( try { // @ts-expect-error let error = new ErrorConstructor(val.message); - // Wipe away the client-side stack trace. Nothing to fill it in with - // because we don't serialize SSR stack traces for security reasons - error.stack = ""; + error.stack = val.stack; serialized[key] = error; } catch (e) { // no-op - fall through and create a normal Error @@ -607,9 +605,7 @@ function deserializeErrors( if (serialized[key] == null) { let error = new Error(val.message); - // Wipe away the client-side stack trace. Nothing to fill it in with - // because we don't serialize SSR stack traces for security reasons - error.stack = ""; + error.stack = val.stack; serialized[key] = error; } } else {