Skip to content

Commit 2fbf60d

Browse files
test(nextjs): Tolerate aborted navigation in streaming RSC error E2E test
Fixes #21836 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8410a0 commit 2fbf60d

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

dev-packages/e2e-tests/test-applications/nextjs-15/tests/streaming-rsc-error.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ test('Should capture errors for crashing streaming promises in server components
2323
return transactionEvent?.transaction === 'GET /streaming-rsc-error/[param]';
2424
});
2525

26-
await page.goto(`/streaming-rsc-error/123`);
26+
// The streaming RSC error can interrupt the HTTP response, causing the navigation to reject
27+
// (e.g. net::ERR_ABORTED) even though the error and transaction are still captured.
28+
await page.goto(`/streaming-rsc-error/123`).catch(() => {});
2729
const errorEvent = await errorEventPromise;
2830
const serverTransactionEvent = await serverTransactionPromise;
2931

dev-packages/e2e-tests/test-applications/nextjs-16-bun/tests/streaming-rsc-error.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ test('Should capture errors for crashing streaming promises in server components
1212
return transactionEvent?.transaction === 'GET /streaming-rsc-error/[param]';
1313
});
1414

15-
await page.goto(`/streaming-rsc-error/123`);
15+
// The streaming RSC error can interrupt the HTTP response, causing the navigation to reject
16+
// (e.g. net::ERR_ABORTED) even though the error and transaction are still captured.
17+
await page.goto(`/streaming-rsc-error/123`).catch(() => {});
1618
const errorEvent = await errorEventPromise;
1719
const serverTransactionEvent = await serverTransactionPromise;
1820

dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/tests/streaming-rsc-error.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ test('Should capture errors for crashing streaming promises in server components
1212
return transactionEvent?.transaction === 'GET /streaming-rsc-error/[param]';
1313
});
1414

15-
await page.goto(`/streaming-rsc-error/123`);
15+
// The streaming RSC error can interrupt the HTTP response, causing the navigation to reject
16+
// (e.g. net::ERR_ABORTED) even though the error and transaction are still captured.
17+
await page.goto(`/streaming-rsc-error/123`).catch(() => {});
1618
const errorEvent = await errorEventPromise;
1719
const serverTransactionEvent = await serverTransactionPromise;
1820

dev-packages/e2e-tests/test-applications/nextjs-16/tests/streaming-rsc-error.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ test('Should capture errors for crashing streaming promises in server components
1212
return transactionEvent?.transaction === 'GET /streaming-rsc-error/[param]';
1313
});
1414

15-
await page.goto(`/streaming-rsc-error/123`);
15+
// The streaming RSC error can interrupt the HTTP response, causing the navigation to reject
16+
// (e.g. net::ERR_ABORTED) even though the error and transaction are still captured.
17+
await page.goto(`/streaming-rsc-error/123`).catch(() => {});
1618
const errorEvent = await errorEventPromise;
1719
const serverTransactionEvent = await serverTransactionPromise;
1820

0 commit comments

Comments
 (0)