Skip to content

Commit

Permalink
Fix error sanitization test
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Apr 8, 2024
1 parent d443999 commit 1323380
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion integration/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 2 additions & 6 deletions packages/react-router-dom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 1323380

Please sign in to comment.