{"record":{"id":"5453e83f47b1afa5","repo":"sveltejs/kit","slug":"app-stores-has-been-removed-in-favour-of-app","errorCode":null,"errorMessage":"`$app/stores` has been removed in favour of `$app/state`. See https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated","messagePattern":"`\\$app/stores` has been removed in favour of `\\$app/state`\\. See https://svelte\\.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2\\.12:-\\$app-stores-deprecated","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/app/stores.js","lineNumber":5,"sourceCode":"// TODO: remove this file when enough people have migrated to Kit 3\n\n/** @returns {never} */\nfunction removed() {\n\tthrow new Error(\n\t\t'`$app/stores` has been removed in favour of `$app/state`. See https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated'\n\t);\n}\n\n/**\n * @deprecated Use `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated))\n */\nexport const getStores = removed;\n\n/**\n * @deprecated Use `page` from `$app/state` instead (requires Svelte 5, [see docs for more info](https://svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated))\n * @type {import('svelte/store').Readable<import('$app/state').Page>}\n */\nexport const page = {\n\tsubscribe: removed\n};\n\n/**","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/app/stores.js#L1-L23","documentation":"The deprecated `$app/stores` module now unconditionally throws: every export (`getStores`, `navigating`, `page`, `updated`) calls `removed()`. SvelteKit removed the legacy stores in favor of the Svelte-5-native `$app/state`. Migrate your imports.","triggerScenarios":"Any import of, or property access on, `$app/stores` in application code after the removal (Kit 3-era code); stale dependencies still importing `$app/stores`.","commonSituations":"Upgrading SvelteKit past the deprecation window without migrating; old tutorial/example code; a library dependency that still uses `$app/stores`.","solutions":["Replace `import { page } from '$app/stores'` with `import { page } from '$app/state'` (requires Svelte 5) and drop `$`-prefix subscription syntax","Update or replace outdated dependencies that import `$app/stores`","Follow the migration guide at svelte.dev/docs/kit/migrating-to-sveltekit-2#SvelteKit-2.12:-$app-stores-deprecated"],"exampleFix":"// before\nimport { page } from '$app/stores';\n$: id = $page.params.id;\n// after\nimport { page } from '$app/state';\nconst id = $derived(page.params.id);","handlingStrategy":"fallback","validationCode":"// Detect the removed import before use (build-time preferable):\nif (typeof page === 'undefined' || typeof page.subscribe !== 'function' && typeof page !== 'object') {\n  console.warn('$app/stores is removed; migrate to $app/state');\n}","typeGuard":"const storesRemoved = (mod) => mod && typeof mod.getStores === 'function'; // presence of legacy exports signals dead code path","tryCatchPattern":"try {\n  const { page } = await import('$app/stores');\n} catch (e) {\n  if (e.message.includes('$app/state')) {\n    const { page } = await import('$app/state');\n  } else throw e;\n}","preventionTips":["Search the codebase for `$app/stores` imports during upgrades and replace with `$app/state`","Pin/audit dependencies that still reference `$app/stores`","Adopt Svelte 5 runes (`$derived`, `$effect`) so `$app/state` works idiomatically"],"tags":["deprecated-api","migration","app-state"],"backgroundTag":"removed-api-import","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}