sveltejs/kit · warning

The `goto(..., { invalidateAll: ${opts.invalidateAll} })` op

Error message

The `goto(..., { invalidateAll: ${opts.invalidateAll} })` option has been deprecated in favour of `refreshAll`

What it means

The `invalidateAll` option of `goto()` was replaced by `refreshAll`, which additionally re-runs load functions outside the current page (server loads etc.). DEV warns once when `invalidateAll` is present in the goto options; the old option will be removed in a future major.

Source

Thrown at packages/kit/src/runtime/client/client.js:2711

	const intent = await resolve_intent(url, 'goto');

	if (opts.shallow) {
		return update_state(
			intent,
			opts.state ?? {},
			{
				replace,
				persist_state: opts.persistState ?? false,
				reset: opts.reset ?? false
			},
			'goto'
		);
	}

	if (DEV && 'invalidateAll' in opts && !warned_on_invalidate_all) {
		warned_on_invalidate_all = true;
		console.warn(
			`The \`goto(..., { invalidateAll: ${opts.invalidateAll} })\` option has been deprecated in favour of \`refreshAll\``
		);
	}

	return _goto(
		intent.url,
		{ ...opts, replace, refreshAll: opts.refreshAll ?? opts.invalidateAll },
		0,
		{},
		intent
	);
}

/**
 * Causes any `load` functions belonging to the currently active page to re-run if they depend on the `url` in question, via `fetch` or `depends`. Returns a `Promise` that resolves when the page is subsequently updated.
 *
 * If the argument is given as a `string` or `URL`, it must resolve to the same URL that was passed to `fetch` or `depends` (including query parameters).
 * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL.

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Replace `{ invalidateAll: true }` with `{ refreshAll: true }`
  2. If only the current page's universal loads must re-run, consider omitting the option and using `invalidate('...')` or `invalidateAll()` from `$app/navigation`
  3. Search the codebase for `invalidateAll` inside goto option objects

Example fix

// before
goto('/profile', { invalidateAll: true });
// after
goto('/profile', { refreshAll: true });
Defensive patterns

Strategy: validation

Validate before calling

const opts = { invalidateAll: true };
if ('invalidateAll' in opts) { opts.refreshAll = opts.invalidateAll; delete opts.invalidateAll; }
goto(url, opts);

Type guard

function usesInvalidateAll(o) { return o != null && 'invalidateAll' in o; }

Prevention

When it happens

Trigger: Calling `goto(url, { invalidateAll: true })` (or false); the `goto` export in packages/kit/src/runtime/client/client.js warns when `'invalidateAll' in opts` in DEV.

Common situations: Post-login or locale-change navigations written against SvelteKit 1.x/early-2.x APIs that reloaded data via `invalidateAll`.

Related errors


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