sveltejs/kit · warning
Reading `config.kit` inside adapters is deprecated — it shou
Error message
Reading `config.kit` inside adapters is deprecated — it should access configuration on the `config` object directly. You may need to update your adapter
What it means
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.
Source
Thrown at packages/kit/src/core/adapt/index.js:40
app_manifest,
log,
remotes,
vite_config,
explicit_env_config
) {
const { name, adapt } = config.adapter;
console.log(styleText(['bold', 'cyan'], `\n> Using ${name}`));
let warned = false;
const builder = create_builder({
config: {
...config,
get kit() {
if (!warned) {
warned = true;
log.warn(
`Reading \`config.kit\` inside adapters is deprecated — it should access configuration on the \`config\` object directly. You may need to update your adapter`
);
}
return config;
}
},
build_data,
server_metadata,
route_data: build_data.manifest_data.routes.filter((route) => route.page || route.endpoint),
prerendered,
prerender_map,
app_manifest,
log,
remotes,
vite_config,
explicit_env_config
});View on GitHub (pinned to 03f1687fe6)
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.
Example fix
// before (adapter code) const outDir = config.kit.outDir; // after const outDir = config.outDir;
Defensive patterns
Strategy: validation
Validate before calling
// Adapter-side guard
if ('kit' in config) {
console.warn('Adapter reads config.kit; update to read config.* directly');
}
const outDir = config.outDir ?? '.svelte-kit/output'; Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The `${keypath}` option is deprecated, and will be removed i
- The _headers file should be placed in the project root rathe
- The _redirects file should be placed in the project root rat
- The `edge` runtime is no longer supported
- The `generateManifest` adapter API has been removed — use `g
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/676aa537a6fa51ff.
Report an issue: GitHub.