sveltejs/kit · error · Error
The `${keypath}` option has been removed. Please see the lis
Error message
The `${keypath}` option has been removed. Please see the list of breaking changes for your major release What it means
This is thrown by the `removed` validator: if any deprecated configuration key that has been removed in a major SvelteKit release is still present (defined, not undefined) in the config object, the build fails with a message pointing to the breaking-changes list. It exists to loudly surface obsolete options rather than silently ignoring them.
Source
Thrown at packages/kit/src/core/config/options.js:361
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);
/**
* @param {(keypath: string) => string} get_message
* @returns {Validator}
*/
function removed(
get_message = (keypath) =>
`The \`${keypath}\` option has been removed. Please see the list of breaking changes for your major release`
) {
return (input, keypath) => {
if (typeof input !== 'undefined') {
throw new Error(get_message(keypath));
}
};
}
/**
* @param {Record<string, Validator>} children
* @param {boolean} [allow_unknown]
* @returns {Validator}
*/
export function object(children, allow_unknown = false) {
return (input, keypath) => {
/** @type {Record<string, any>} */
const output = {};
if ((input && typeof input !== 'object') || Array.isArray(input)) {
throw new Error(`${keypath} should be an object`);
}
View on GitHub (pinned to 03f1687fe6)
Solutions
- Delete the removed option from svelte.config.js.
- Check the SvelteKit major-release migration guide for the option's replacement and use that instead.
- Update outdated templates/examples you copied the config from.
Example fix
// before (SvelteKit 2)
const config = {
kit: { adapter: adapter(), trailingSlash: 'always' }
};
// after
const config = {
kit: { adapter: adapter(), trailingSlash: 'always', prerender: {} }
};
// (remove the specific key named in the error; consult the migration guide) Defensive patterns
Strategy: validation
Validate before calling
import { validate_config } from '@sveltejs/kit/config'; // or run `vite dev` once in CI
validate_config(rawConfig); // fails fast with named removed keys before build Type guard
function hasRemovedOptions(cfg, removedKeys) { return removedKeys.filter((k) => cfg.kit && k in cfg.kit); } Try / catch
try {
validate_config(config);
} catch (e) {
if (String(e.message).includes('has been removed')) {
console.error('Upgrade needed:', e.message, '— see https://github.com/sveltejs/kit/discussions/5774');
process.exit(1);
} else throw e;
} Prevention
- Read the migration guide whenever bumping SvelteKit majors.
- Delete old options rather than commenting them out.
- Run config validation in CI before builds on upgrade PRs.
When it happens
Trigger: Keeping an option from a previous major version in svelte.config.js (e.g. under `kit.` keys that were removed between SvelteKit versions) while upgrading, so validate_options detects a defined value for a removed key.
Common situations: Upgrading SvelteKit across a major boundary (e.g. 1.x to 2.x) without pruning old options; following an outdated tutorial or copying an old svelte.config.js from another project.
Related errors
- The `generateManifest` adapter API has been removed — use `g
- SvelteKit configuration (${keys}) no longer lives inside a `
- `defineEnvVars` has moved — import it from `@sveltejs/kit/en
- exports is not available in dev mode
- Instrumentation file ${instrumentation} not found. This is p
AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02).
Data as JSON: /api/errors/ae637a50b565b1e4.
Report an issue: GitHub.