Skip to content

Commit e16452a

Browse files
add shell error logging logic
1 parent 1322315 commit e16452a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

integration-test/react-router-cloudflare/app/entry.server.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default async function handleRequest(
2424
// vercel-specific options, originating from `@vercel/react-router/entry.server.js`
2525
options?: RenderOptions
2626
) {
27+
let shellRendered = false;
2728
const userAgent = request.headers.get("user-agent");
2829
const client = makeClient(request);
2930

@@ -47,10 +48,14 @@ export default async function handleRequest(
4748
signal: abortController.signal,
4849
onError(error: unknown) {
4950
responseStatusCode = 500;
50-
console.error(error);
51+
52+
if (shellRendered) {
53+
console.error(error);
54+
}
5155
},
5256
}
5357
);
58+
shellRendered = true;
5459

5560
// BUG: I tried to port this over /integration-test/react-router/app/entry.server.tsx
5661
// But it breaks with a hydration error if I manually set shouldWaitForAllContent = true.

0 commit comments

Comments
 (0)