{"record":{"id":"95b39288da3e1f31","repo":"sveltejs/kit","slug":"the-goto-invalidateall-opts-invalidatea","errorCode":null,"errorMessage":"The `goto(..., { invalidateAll: ${opts.invalidateAll} })` option has been deprecated in favour of `refreshAll`","messagePattern":"The `goto\\(\\.\\.\\., (.+?)\\)` option has been deprecated in favour of `refreshAll`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/runtime/client/client.js","lineNumber":2711,"sourceCode":"\n\tconst intent = await resolve_intent(url, 'goto');\n\n\tif (opts.shallow) {\n\t\treturn update_state(\n\t\t\tintent,\n\t\t\topts.state ?? {},\n\t\t\t{\n\t\t\t\treplace,\n\t\t\t\tpersist_state: opts.persistState ?? false,\n\t\t\t\treset: opts.reset ?? false\n\t\t\t},\n\t\t\t'goto'\n\t\t);\n\t}\n\n\tif (DEV && 'invalidateAll' in opts && !warned_on_invalidate_all) {\n\t\twarned_on_invalidate_all = true;\n\t\tconsole.warn(\n\t\t\t`The \\`goto(..., { invalidateAll: ${opts.invalidateAll} })\\` option has been deprecated in favour of \\`refreshAll\\``\n\t\t);\n\t}\n\n\treturn _goto(\n\t\tintent.url,\n\t\t{ ...opts, replace, refreshAll: opts.refreshAll ?? opts.invalidateAll },\n\t\t0,\n\t\t{},\n\t\tintent\n\t);\n}\n\n/**\n * 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.\n *\n * 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).\n * To create a custom identifier, use a string beginning with `[a-z]+:` (e.g. `custom:state`) — this is a valid URL.","sourceCodeStart":2693,"sourceCodeEnd":2729,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/client/client.js#L2693-L2729","documentation":"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.","triggerScenarios":"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.","commonSituations":"Post-login or locale-change navigations written against SvelteKit 1.x/early-2.x APIs that reloaded data via `invalidateAll`.","solutions":["Replace `{ invalidateAll: true }` with `{ refreshAll: true }`","If only the current page's universal loads must re-run, consider omitting the option and using `invalidate('...')` or `invalidateAll()` from `$app/navigation`","Search the codebase for `invalidateAll` inside goto option objects"],"exampleFix":"// before\ngoto('/profile', { invalidateAll: true });\n// after\ngoto('/profile', { refreshAll: true });","handlingStrategy":"validation","validationCode":"const opts = { invalidateAll: true };\nif ('invalidateAll' in opts) { opts.refreshAll = opts.invalidateAll; delete opts.invalidateAll; }\ngoto(url, opts);","typeGuard":"function usesInvalidateAll(o) { return o != null && 'invalidateAll' in o; }","tryCatchPattern":null,"preventionTips":["Use `refreshAll` in goto options going forward","Centralize goto option construction in a helper"],"tags":["deprecation","navigation","client-side"],"backgroundTag":"deprecated-option","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}