sveltejs/kit · warning
The `${keypath}` option is deprecated, and will be removed i
Error message
The `${keypath}` option is deprecated, and will be removed in a future version What it means
SvelteKit's config validator wraps deprecated option validators via `deprecate` in options.js and warns when a deprecated config option is set. It is a non-fatal console warning emitted during `vite dev`/`build` config validation. The option still works today but will be removed in a future version.
Source
Thrown at packages/kit/src/core/config/options.js:333
)
};
/** @type {Validator<ValidatedConfig>} */
export const validate_options = object(options, true);
/**
* @param {Validator} fn
* @param {(keypath: string) => string} get_message
* @returns {Validator}
*/
function deprecate(
fn,
get_message = (keypath) =>
`The \`${keypath}\` option is deprecated, and will be removed in a future version`
) {
return (input, keypath) => {
if (input !== undefined) {
console.warn(styleText(['bold', 'yellow'], get_message(keypath)));
}
return fn(input, keypath);
};
}
// Derive the names of SvelteKit's own config options from the schema, so they
// stay in sync automatically. These are used to separate Kit's options from
// `vite-plugin-svelte`'s options when config is passed via the Vite plugin.
const kit_defaults = validate_options({}, 'config');
/** The names of the options that live under the `kit` namespace */
export const kit_options = Object.keys(kit_defaults);
/** The names of the options that live under the `kit.experimental` namespace */
export const kit_experimental_options = Object.keys(kit_defaults.experimental);
/**View on GitHub (pinned to 03f1687fe6)
Solutions
- Remove the deprecated option from svelte.config.js or rename it to the current option name shown in the SvelteKit docs/changelog
- Regenerate config defaults with `npx sv create` or check `packages/kit/src/core/config/options.js` for what replaced the option
- Silence temporarily by removing the key if you don't rely on its behavior
Example fix
// before
const config = { kit: { adapter: adapter(), someOldOption: true } };
// after
const config = { kit: { adapter: adapter() } }; // option removed/renamed per migration guide Defensive patterns
Strategy: validation
Validate before calling
// before dev/build: scan svelte.config.js against current option names
const deprecated = ['someOldOption'];
for (const key of deprecated) if (key in config.kit) console.warn(`remove kit.${key}`); Type guard
/** @returns {boolean} */ function hasDeprecatedOption(config, key) { return config?.kit && key in config.kit; } Prevention
- Read the SvelteKit changelog's breaking/deprecation section on every minor upgrade
- Keep svelte.config.js minimal and regenerate it from new templates
- Treat dev-server warnings as CI failures with a log-scan step
When it happens
Trigger: Setting any option wrapped by `deprecate(...)` in svelte.config.js to a non-undefined value, e.g. a renamed or relocated option like an old `kit.*` or adapter option.
Common situations: Upgrading SvelteKit/adapter versions while keeping an old svelte.config.js; copying config snippets from outdated tutorials; typos that match a deprecated alias.
Related errors
- Reading `config.kit` inside adapters is deprecated — it shou
- ${keypath} cannot be empty
- Each member of ${keypath} must start with '.' — saw '${exten
- SvelteKit configuration (${keys}) no longer lives inside a `
- ${keypath} should be one of "${options}" or "${options[optio
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/c0d889fb54b1a6a2.
Report an issue: GitHub.