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

  1. Delete the removed option from svelte.config.js.
  2. Check the SvelteKit major-release migration guide for the option's replacement and use that instead.
  3. 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

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


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/ae637a50b565b1e4. Report an issue: GitHub.