{"record":{"id":"676aa537a6fa51ff","repo":"sveltejs/kit","slug":"reading-config-kit-inside-adapters-is-deprecated","errorCode":null,"errorMessage":"Reading `config.kit` inside adapters is deprecated — it should access configuration on the `config` object directly. You may need to update your adapter","messagePattern":"Reading `config\\.kit` inside adapters is deprecated — it should access configuration on the `config` object directly\\. You may need to update your adapter","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/core/adapt/index.js","lineNumber":40,"sourceCode":"\tapp_manifest,\n\tlog,\n\tremotes,\n\tvite_config,\n\texplicit_env_config\n) {\n\tconst { name, adapt } = config.adapter;\n\n\tconsole.log(styleText(['bold', 'cyan'], `\\n> Using ${name}`));\n\n\tlet warned = false;\n\n\tconst builder = create_builder({\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tget kit() {\n\t\t\t\tif (!warned) {\n\t\t\t\t\twarned = true;\n\t\t\t\t\tlog.warn(\n\t\t\t\t\t\t`Reading \\`config.kit\\` inside adapters is deprecated — it should access configuration on the \\`config\\` object directly. You may need to update your adapter`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn config;\n\t\t\t}\n\t\t},\n\t\tbuild_data,\n\t\tserver_metadata,\n\t\troute_data: build_data.manifest_data.routes.filter((route) => route.page || route.endpoint),\n\t\tprerendered,\n\t\tprerender_map,\n\t\tapp_manifest,\n\t\tlog,\n\t\tremotes,\n\t\tvite_config,\n\t\texplicit_env_config\n\t});","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/adapt/index.js#L22-L58","documentation":"In older SvelteKit versions, adapters read `config.kit` to access kit configuration. Now the config object passed to adapters already contains the resolved kit fields merged at the top level, so `config.kit` is a shim that returns the whole config (not the kit section) and warns once per adapt() run that reading `config.kit` inside adapters is deprecated and the adapter should be updated.","triggerScenarios":"Running adapt() with a third-party or outdated adapter whose code accesses `config.kit.*` instead of `config.*`, triggering the lazy getter installed by create_builder in the kit config wrapper.","commonSituations":"Using an old community adapter pinned to a pre-1.0 SvelteKit; a custom in-house adapter written against legacy `config.kit` paths; failing to upgrade an adapter after a SvelteKit version bump.","solutions":["Update the adapter package to its latest version compatible with current SvelteKit.","If it's your own adapter, replace every `config.kit.x` access with `config.x` (fields are hoisted to the top level).","Check adapter issues/changelog for deprecation notes and migrate accordingly."],"exampleFix":"// before (adapter code)\nconst outDir = config.kit.outDir;\n// after\nconst outDir = config.outDir;","handlingStrategy":"validation","validationCode":"// Adapter-side guard\nif ('kit' in config) {\n  console.warn('Adapter reads config.kit; update to read config.* directly');\n}\nconst outDir = config.outDir ?? '.svelte-kit/output';","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin and regularly update community adapters","Grep custom adapters for `config.kit` during SvelteKit upgrades","Read the SvelteKit adapter API changelog when bumping major versions"],"tags":["deprecation","adapter","config","sveltekit"],"backgroundTag":"deprecated-config-access","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}