Skip to content

Commit 860076a

Browse files
committed
fix(remix): Fix issue of creating multiple branches of a single stream on Cloudflare Workers
1 parent b52a63c commit 860076a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎.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)