{"record":{"id":"8940c07762a0782f","repo":"sveltejs/kit","slug":"sveltekit-configuration-keys-no-longer-lives","errorCode":null,"errorMessage":"SvelteKit configuration (${keys}) no longer lives inside a `kit` namespace. Pass it directly to the `sveltekit(...)` Vite plugin","messagePattern":"SvelteKit configuration \\((.+?)\\) no longer lives inside a `kit` namespace\\. Pass it directly to the `sveltekit\\(\\.\\.\\.\\)` Vite plugin","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/config/options.js","lineNumber":171,"sourceCode":"\t\t\t\t`\\`${keypath}\\` has been removed. Use #lib instead of $lib: https://svelte.dev/docs/kit/$lib`\n\t\t),\n\t\tparams: string(null),\n\t\troutes: string(null),\n\t\tserviceWorker: string(null),\n\t\tappTemplate: string(null),\n\t\terrorTemplate: string(null)\n\t}),\n\n\tinlineStyleThreshold: number(0),\n\n\tmoduleExtensions: string_array(['.js', '.ts']),\n\n\tkit: validate(undefined, (input) => {\n\t\tconst keys = Object.keys(input)\n\t\t\t.map((key) => `\\`${key}\\``)\n\t\t\t.join(', ');\n\n\t\tthrow new Error(\n\t\t\t`SvelteKit configuration (${keys}) no longer lives inside a \\`kit\\` namespace. Pass it directly to the \\`sveltekit(...)\\` Vite plugin`\n\t\t);\n\t}),\n\n\toutDir: string('.svelte-kit'),\n\n\toutput: object({\n\t\tlinkHeaderPreload: boolean(false),\n\t\tpreloadStrategy: removed(\n\t\t\t(keypath) => `\\`${keypath}\\` has been removed. modulepreload will always be used`\n\t\t),\n\t\tbundleStrategy: list(['split', 'single', 'inline'])\n\t}),\n\n\tpaths: object({\n\t\tbase: validate('', (input, keypath) => {\n\t\t\tassert_string(input, keypath);\n","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/config/options.js#L153-L189","documentation":"Older SvelteKit versions nested all config under a top-level `kit` object (`kit: { paths: {...} }`). Now SvelteKit options are passed directly at the top level (or directly to the `sveltekit(...)` Vite plugin), and any `kit` key is rejected, listing the nested keys found.","triggerScenarios":"Upgrading from an old SvelteKit version and keeping `kit: { ... }` in svelte.config.js; following outdated tutorials/docs that use the `kit` namespace; migrating a Vite config that passed kit options inside the plugin options under `kit`.","commonSituations":"Version migration (SvelteKit pre-1.0 → 1.x/2.x); AI or docs-generated config from old examples; merging old config files into new projects.","solutions":["Hoist the nested keys to the top level: `kit: { paths: {...} }` becomes `paths: {...}`","Remove the `kit` wrapper key entirely","If configuring via Vite, pass options directly to the `sveltekit(...)` plugin, not nested","Consult the current configuration docs and migrate each listed key (the error names them)"],"exampleFix":"// before\nconst config = {\n  kit: { paths: { base: '/app' } }\n};\n// after\nconst config = {\n  paths: { base: '/app' }\n};","handlingStrategy":"validation","validationCode":"if ('kit' in config) {\n  throw new Error(`Move kit.* keys (${Object.keys(config.kit ?? {}).join(', ')}) to the top level`);\n}","typeGuard":"function hasNoKitNamespace(config) {\n  return !('kit' in config);\n}","tryCatchPattern":"try {\n  loadConfig();\n} catch (e) {\n  if (String(e.message).includes('no longer lives inside a `kit` namespace')) {\n    console.error('Flatten the kit object to top-level keys per current SvelteKit docs');\n  }\n  throw e;\n}","preventionTips":["On upgrade, run the official migration script (`npx sv migrate`)","Never copy `kit: {}` wrappers from pre-1.0 tutorials or AI-generated old examples","Keep svelte.config.js in sync with the installed SvelteKit major version"],"tags":["config","migration","breaking-change","sveltekit"],"backgroundTag":"deprecated-config-schema","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}