Skip to content

Commit 3a0eacd

Browse files
authored
fix(remix): Fix issue of creating multiple branches of a single stream on Cloudflare Workers (#2953)
1 parent 141f09f commit 3a0eacd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/shiny-ties-complain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/remix': patch
3+
---
4+
5+
Replace `response.clone()` with `new Response(response.body, response)` to avoid creating multiple branches of a single stream on Cloudflare workers ([issue reference](https://github.com/cloudflare/workers-sdk/issues/3259)).

packages/remix/src/ssr/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const injectRequestStateIntoResponse = async (
6464
requestState: RequestState,
6565
context: AppLoadContext,
6666
) => {
67-
const clone = response.clone();
67+
const clone = new Response(response.body, response);
6868
const data = await clone.json();
6969

7070
const { clerkState, headers } = getResponseClerkState(requestState, context);

0 commit comments

Comments
 (0)