{"record":{"id":"27af084963164bcb","repo":"sveltejs/kit","slug":"config-package-is-no-longer-supported-see-https","errorCode":null,"errorMessage":"config.package is no longer supported. See https://github.com/sveltejs/kit/pull/8922 for more information and how to migrate.","messagePattern":"config\\.package is no longer supported\\. See https://github\\.com/sveltejs/kit/pull/8922 for more information and how to migrate\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/package/src/cli.js","lineNumber":77,"sourceCode":"\nconst { values } = parsed;\n\nif (values.version) {\n\tconsole.log(pkg.version);\n\tprocess.exit(0);\n}\n\nif (values.help) {\n\tconsole.log(help);\n\tprocess.exit(0);\n}\n\ntry {\n\tconst config = await load_config();\n\n\t// @ts-expect-error\n\tif (config.package) {\n\t\tthrow new Error(\n\t\t\t'config.package is no longer supported. See https://github.com/sveltejs/kit/pull/8922 for more information and how to migrate.'\n\t\t);\n\t}\n\n\tconst packaging = await import('./index.js');\n\n\t/** @type {Options} */\n\tconst options = {\n\t\tcwd: process.cwd(),\n\t\tinput: values.input ?? config.files?.lib ?? 'src/lib',\n\t\toutput: values.output,\n\t\tpreserve_output: values['preserve-output'],\n\t\ttsconfig: values.tsconfig,\n\t\ttypes: values.types,\n\t\tconfig\n\t};\n\n\tawait (values.watch ? packaging.watch(options) : packaging.build(options));","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/package/src/cli.js#L59-L95","documentation":"@sveltejs/package no longer reads a `package` section from svelte.config.js. In PR #8922 all packaging options moved from `config.package` to the CLI's own options file, so the CLI deliberately throws if the legacy key is still present, forcing migration rather than silently ignoring the settings.","triggerScenarios":"Running `svelte-package` (via `pnpm build`/npm script) in a project whose svelte.config.js still contains a top-level `package: { ... }` object.","commonSituations":"Upgrading an older SvelteKit/library project from @sveltejs/package v1 to v2 without removing the old config section; copying a stale svelte.config.js from an older template.","solutions":["Remove the `package` object from svelte.config.js.","Move packaging settings to a package.json `svelte` field or CLI flags per the migration guide at github.com/sveltejs/kit/pull/8922.","Update the build script to the new `svelte-package -i src/lib -o dist` style invocation."],"exampleFix":"// before (svelte.config.js)\nconst config = {\n  preprocess: vitePreprocess(),\n  package: { exports: (filepath) => !/_internal/ } };\n\n// after\nconst config = {\n  preprocess: vitePreprocess()\n};\n// then in package.json:\n// \"scripts\": { \"build\": \"svelte-package -i src/lib\" }","handlingStrategy":"validation","validationCode":"import { config } from './svelte.config.js';\nif ('package' in config) throw new Error('remove config.package before svelte-package v2');","typeGuard":null,"tryCatchPattern":"try {\n  await run(['svelte-package']);\n} catch (e) {\n  if (String(e.message).includes('config.package is no longer supported')) {\n    throw new Error('Migrate packaging options out of svelte.config.js (PR #8922)');\n  }\n  throw e;\n}","preventionTips":["Keep packaging options in CLI flags/package.json, not svelte.config.js","Read the changelog when bumping @sveltejs/package major versions","Grep svelte.config.js for legacy keys after upgrades"],"tags":["config","breaking-change","migration","packaging"],"backgroundTag":"removed-config-option","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}