Skip to content

Commit 2078bf4

Browse files
committed
set remote_responses lazily
1 parent d1e5cf7 commit 2078bf4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/kit/src/runtime/client/client.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ let target;
189189
/** @type {import('./types.js').SvelteKitApp} */
190190
export let app;
191191

192-
/** @type {Record<string, any>} */
193192
// we have to conditionally access the properties of `__SVELTEKIT_PAYLOAD__`
194193
// because it will be `undefined` when users import the exports from this module.
195194
// It's only defined when the server renders a page.
196-
export const remote_responses = __SVELTEKIT_PAYLOAD__?.data ?? {};
195+
/** @type {Record<string, any>} */
196+
export let remote_responses = {};
197197

198198
/** @type {Array<((url: URL) => boolean)>} */
199199
const invalidated = [];
@@ -294,6 +294,10 @@ export async function start(_app, _target, hydrate) {
294294
);
295295
}
296296

297+
if (__SVELTEKIT_PAYLOAD__.data) {
298+
remote_responses = __SVELTEKIT_PAYLOAD__?.data;
299+
}
300+
297301
// detect basic auth credentials in the current URL
298302
// https://github.com/sveltejs/kit/pull/11179
299303
// if so, refresh the page without credentials

0 commit comments

Comments
 (0)