{"record":{"id":"ae637a50b565b1e4","repo":"sveltejs/kit","slug":"the-keypath-option-has-been-removed-please-s","errorCode":null,"errorMessage":"The `${keypath}` option has been removed. Please see the list of breaking changes for your major release","messagePattern":"The `(.+?)` option has been removed\\. Please see the list of breaking changes for your major release","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/config/options.js","lineNumber":361,"sourceCode":"const kit_defaults = validate_options({}, 'config');\n\n/** The names of the options that live under the `kit` namespace */\nexport const kit_options = Object.keys(kit_defaults);\n\n/** The names of the options that live under the `kit.experimental` namespace */\nexport const kit_experimental_options = Object.keys(kit_defaults.experimental);\n\n/**\n * @param {(keypath: string) => string} get_message\n * @returns {Validator}\n */\nfunction removed(\n\tget_message = (keypath) =>\n\t\t`The \\`${keypath}\\` option has been removed. Please see the list of breaking changes for your major release`\n) {\n\treturn (input, keypath) => {\n\t\tif (typeof input !== 'undefined') {\n\t\t\tthrow new Error(get_message(keypath));\n\t\t}\n\t};\n}\n\n/**\n * @param {Record<string, Validator>} children\n * @param {boolean} [allow_unknown]\n * @returns {Validator}\n */\nexport function object(children, allow_unknown = false) {\n\treturn (input, keypath) => {\n\t\t/** @type {Record<string, any>} */\n\t\tconst output = {};\n\n\t\tif ((input && typeof input !== 'object') || Array.isArray(input)) {\n\t\t\tthrow new Error(`${keypath} should be an object`);\n\t\t}\n","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/config/options.js#L343-L379","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (SvelteKit 2)\nconst config = {\n  kit: { adapter: adapter(), trailingSlash: 'always' }\n};\n// after\nconst config = {\n  kit: { adapter: adapter(), trailingSlash: 'always', prerender: {} }\n};\n// (remove the specific key named in the error; consult the migration guide)","handlingStrategy":"validation","validationCode":"import { validate_config } from '@sveltejs/kit/config'; // or run `vite dev` once in CI\nvalidate_config(rawConfig); // fails fast with named removed keys before build","typeGuard":"function hasRemovedOptions(cfg, removedKeys) { return removedKeys.filter((k) => cfg.kit && k in cfg.kit); }","tryCatchPattern":"try {\n  validate_config(config);\n} catch (e) {\n  if (String(e.message).includes('has been removed')) {\n    console.error('Upgrade needed:', e.message, '— see https://github.com/sveltejs/kit/discussions/5774');\n    process.exit(1);\n  } else throw e;\n}","preventionTips":["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."],"tags":["sveltekit","breaking-change","config-migration","deprecated-option"],"backgroundTag":"removed-config-option","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}