Skip to content

Commit 7c5e6e7

Browse files
committed
Update server-runtime.ts
1 parent a91ce5f commit 7c5e6e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/start/src/server/server-runtime.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ async function fetchServerFunction(
5959
if (response.body) {
6060
/* @ts-ignore-next-line */
6161
response.customBody = () => {
62-
// TODO check for serialization mode
63-
return deserializeJSStream(instance, response);
62+
if (import.meta.env.SEROVAL_MODE === "js") {
63+
return deserializeJSStream(instance, response);
64+
}
65+
return deserializeJSONStream(response);
6466
};
6567
}
6668
return response;
@@ -73,7 +75,6 @@ async function fetchServerFunction(
7375
} else if (contentType && contentType.startsWith("application/json")) {
7476
result = await response.json();
7577
} else if (import.meta.env.SEROVAL_MODE === "js") {
76-
// TODO check for serialization mode
7778
result = await deserializeJSStream(instance, response);
7879
} else {
7980
result = await deserializeJSONStream(response);

0 commit comments

Comments
 (0)