Skip to content

Commit 588946f

Browse files
authored
fix(cloudflare): ignore errors when the stream is already closed (#1011)
1 parent 596587f commit 588946f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/poor-buttons-peel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/aws": patch
3+
---
4+
5+
fix(cloudflare): ignore errors when the stream is already closed

packages/open-next/src/overrides/wrappers/cloudflare-node.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ const handler: WrapperHandler<InternalEvent, InternalResult> =
9494
if (error) {
9595
controller.error(error);
9696
} else {
97-
controller.close();
97+
try {
98+
controller.close();
99+
} catch {
100+
// Ignore "This ReadableStream is closed" error
101+
}
98102
}
99103
callback(error);
100104
},

0 commit comments

Comments
 (0)