Skip to content

Commit fe929d4

Browse files
authored
Port CF Remix issues changes to v4 (#2979)
* fix(remix): Fix issue that was creating multiple branches of a single stream on Cloudflare Workers * chore(repo): Add Changeset
1 parent 5850062 commit fe929d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/fifty-flies-greet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/remix': minor
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
@@ -109,7 +109,7 @@ export const injectRequestStateIntoResponse = async (
109109
requestState: RequestState,
110110
context: AppLoadContext,
111111
) => {
112-
const clone = response.clone();
112+
const clone = new Response(response.body, response);
113113
const data = await clone.json();
114114
const { clerkState, headers } = getResponseClerkState(requestState, context);
115115
// set the correct content-type header in case the user returned a `Response` directly

0 commit comments

Comments
 (0)