sveltejs/kit · warning

${node.server_id}: Calling `parent(...)` in a promise handle

Error message

${node.server_id}: Calling `parent(...)` in a promise handler after `load(...)` has returned will not cause the function to re-run when parent data changes

What it means

`parent()` in a `load` function declares a dependency on the parent route's load data. Calling it inside a promise handler after `load` has returned means the parent dependency is registered too late, so changes to parent data will not re-run this load function. The dev warning flags the lost reactivity.

Source

Thrown at packages/kit/src/runtime/server/page/load_data.js:135

					params: new Proxy(event.params, {
						get: (target, key) => {
							if (DEV && done && typeof key === 'string' && !uses.params.has(key)) {
								console.warn(
									`${node.server_id}: Accessing \`params.${String(
										key
									)}\` in a promise handler after \`load(...)\` has returned will not cause the function to re-run when the param changes`
								);
							}

							if (is_tracking) {
								uses.params.add(key);
							}
							return target[/** @type {string} */ (key)];
						}
					}),
					parent: async () => {
						if (DEV && done && !uses.parent) {
							console.warn(
								`${node.server_id}: Calling \`parent(...)\` in a promise handler after \`load(...)\` has returned will not cause the function to re-run when parent data changes`
							);
						}

						if (is_tracking) {
							uses.parent = true;
						}
						return parent();
					},
					route: new Proxy(event.route, {
						get: (target, key) => {
							if (DEV && done && typeof key === 'string' && !uses.route) {
								console.warn(
									`${node.server_id}: Accessing \`route.${String(
										key
									)}\` in a promise handler after \`load(...)\` has returned will not cause the function to re-run when the route changes`
								);
							}

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Call `await parent()` synchronously near the top of `load`, before other awaits that defer work.
  2. Extract needed parent fields immediately and pass them into subsequent async logic.
  3. Restructure helper functions so `parent()` is invoked within the tracked load body.

Example fix

// before
export function load({ parent }) {
  return getData().then(async (d) => ({ d, ...(await parent()) }));
}
// after
export async function load({ parent }) {
  const p = await parent();
  const d = await getData();
  return { d, ...p };
}
Defensive patterns

Strategy: validation

Validate before calling

export async function load({ parent }) {
  const parentData = await parent(); // await parent first
  const data = await getData(parentData.userId);
  return { data };
}

Prevention

When it happens

Trigger: Server `load` calls `await parent()` (or `parent().then(...)`) inside a post-return continuation when `uses.parent` is still false — i.e. parent was never awaited during the tracked portion of the body.

Common situations: Awaiting parent data inside nested `.then()` chains; helper functions that call `parent()` asynchronously after the load body already returned its promise.

Related errors


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/3f8c482340ef736c. Report an issue: GitHub.