Skip to content

Commit cab02b9

Browse files
committed
fix: wrap payments ErrorBoundary in html document shell
1 parent a7329a6 commit cab02b9

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

apps/builder/app/routes/payments.$.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,17 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
120120
export const ErrorBoundary = () => {
121121
const error = useRouteError();
122122

123-
if (isRouteErrorResponse(error)) {
124-
return <div style={{ whiteSpace: "pre-wrap" }}>{error.data}</div>;
125-
}
126-
127-
return <div>Unexpected error</div>;
123+
const message = isRouteErrorResponse(error) ? error.data : "Unexpected error";
124+
125+
return (
126+
<html lang="en">
127+
<head>
128+
<meta charSet="utf-8" />
129+
<title>Error</title>
130+
</head>
131+
<body>
132+
<div style={{ whiteSpace: "pre-wrap" }}>{message}</div>
133+
</body>
134+
</html>
135+
);
128136
};

0 commit comments

Comments
 (0)