sveltejs/kit · warning
The `update({ invalidateAll })` option has been deprecated i
Error message
The `update({ invalidateAll })` option has been deprecated in favour of `update({ refreshAll })` What it means
SvelteKit deprecated the `invalidateAll` option in `form.update()` in favour of the unified `refreshAll` option, which also re-runs load functions outside the current page. The library warns once in DEV when the old option is passed so developers migrate before SvelteKit 4.0 removes it.
Source
Thrown at packages/kit/src/runtime/app/forms/client.js:76
/**
* @param {{
* result: ActionResult;
* reset?: boolean;
* refreshAll?: boolean;
* invalidateAll?: boolean;
* navigate?: boolean;
* }} opts
*/
const fallback_callback = async ({
result,
reset = true,
refreshAll: should_refresh_all,
invalidateAll: deprecated_invalidate_all,
navigate = true
}) => {
if (DEV && deprecated_invalidate_all !== undefined) {
console.warn(
'The `update({ invalidateAll })` option has been deprecated in favour of `update({ refreshAll })`'
);
}
should_refresh_all ??= deprecated_invalidate_all ?? result.type === 'success';
if (result.type === 'success' && reset) {
// We call reset from the prototype to avoid DOM clobbering
HTMLFormElement.prototype.reset.call(form_element);
}
const destination =
navigate && result.type !== 'redirect' && !is_current_location(result.location)
? result.location
: undefined;
if (destination === undefined) {
if (should_refresh_all && result.type !== 'redirect') {View on GitHub (pinned to 03f1687fe6)
Solutions
- Replace `update({ invalidateAll: true })` with `update({ refreshAll: true })`
- If you only need the current page's loads re-run, omit the option entirely — success results invalidate by default
- Remove any leftover `invalidateAll` keys from form update options via codemod/grep across the codebase
Example fix
// before
applyAction(result).then(() => update({ invalidateAll: true }));
// after
applyAction(result).then(() => update({ refreshAll: true })); Defensive patterns
Strategy: validation
Validate before calling
// before calling update
const opts = { invalidateAll: true };
if ('invalidateAll' in opts) opts.refreshAll = opts.invalidateAll;
delete opts.invalidateAll;
update(opts); Type guard
function usesInvalidateAll(opts) { return opts != null && 'invalidateAll' in opts; } Prevention
- Always use `refreshAll` in new code
- Add a lint rule/grep check for `invalidateAll` in form update options
- Read the SvelteKit 2 migration guide when upgrading
When it happens
Trigger: Calling `update()` on the result of a form submission (`<form method="POST">` action) with `{ invalidateAll: true }` (or any value) while running in DEV mode; `fallback_callback` in packages/kit/src/runtime/app/forms/client.js warns during the handle_submit flow.
Common situations: Codebases upgraded from SvelteKit 1.x to 2.x that used `invalidateAll` to re-run `+page(.server).js` load functions after a successful form action; tutorials and older docs still showing `update({ invalidateAll: true })`.
Related errors
- `export const snapshot` is deprecated. Use the `snapshot` he
- The `goto(..., { replaceState: ${opts.replaceState} })` opti
- The `goto(..., { invalidateAll: ${opts.invalidateAll} })` op
- use:enhance can only be used on <form> fields with method="P
- Your form contains <input type="file"> fields, but is missin
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/cbc4de4df0b4ab20.
Report an issue: GitHub.