[fix] set rawBody to null when body is nullish in simulated load fetch
ADD
.changeset/polite-donkeys-learn.md
+---
+'@sveltejs/kit': patch
+---
+
+avoid setting rawBody/body to an empty Uint8Array when a load's fetch function is called with no body during SSR

MODIFY
packages/kit/src/runtime/server/page/load_node.js
packages/kit/src/runtime/server/page/load_node.js
@@ -151,7 +151,7 @@ export async function load_node({
method: opts.method || 'GET',
headers,
path: relative,
- rawBody: new TextEncoder().encode(/** @type {string} */ (opts.body)),
+ rawBody: opts.body == null ? null : new TextEncoder().encode(opts.body),
query: new URLSearchParams(search)
},
options,

[fix] set rawBody to null when body is nullish in simulated load fetch (#2295)