{"record":{"id":"67e05dd48d9bb232","repo":"sveltejs/kit","slug":"file-is-no-longer-used-please-pass-configurati","errorCode":null,"errorMessage":"${file} is no longer used. Please pass configuration via the `sveltekit(...)` plugin in your Vite config.","messagePattern":"(.+?) is no longer used\\. Please pass configuration via the `sveltekit\\(\\.\\.\\.\\)` plugin in your Vite config\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/exports/vite/index.js","lineNumber":289,"sourceCode":"\t/** @type {string} the `__sveltekit_xxx` name, without `globalThis.` */\n\tlet global_name;\n\n\t/** @type {string} name for `globalThis.__sveltekit_xxx` */\n\tlet kit_global;\n\n\t/** @type {Plugin} */\n\tconst plugin_resolve_root = {\n\t\tname: 'vite-plugin-sveltekit-resolve-root',\n\t\t// make sure it runs first\n\t\tenforce: 'pre',\n\t\tconfig: {\n\t\t\torder: 'pre',\n\t\t\thandler(config) {\n\t\t\t\troot = resolve_root(config);\n\n\t\t\t\tfor (const file of ['svelte.config.js', 'svelte.config.ts']) {\n\t\t\t\t\tif (fs.existsSync(path.join(root, file))) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`${file} is no longer used. Please pass configuration via the \\`sveltekit(...)\\` plugin in your Vite config.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/** @type {Plugin} */\n\tconst plugin_setup = {\n\t\tname: 'vite-plugin-sveltekit-setup',\n\t\tapi: {\n\t\t\toptions: svelte_config\n\t\t},\n\t\tresolveId: {\n\t\t\tfilter: { id: removed_modules.map(({ pattern }) => pattern) },\n\t\t\tasync handler(id, importer, options) {\n\t\t\t\tconst resolved = await this.resolve(id, importer, { ...options, skipSelf: true });","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/exports/vite/index.js#L271-L307","documentation":"This version of SvelteKit expects configuration via the `sveltekit(...)` Vite plugin options rather than a `svelte.config.js`/`svelte.config.ts` file in the project root. If such a file exists, the pre-plugin throws immediately to prevent silently ignored configuration.","triggerScenarios":"Having `svelte.config.js` or `svelte.config.ts` in the Vite root directory while running `vite dev`/`vite build` with the current SvelteKit Vite plugin.","commonSituations":"Migrating an older SvelteKit project (or one from the pre-1.0/plugin-based layout) to the plugin-options configuration style; copying a svelte.config.js from an unrelated Svelte project; scaffolding tools that still emit svelte.config.js.","solutions":["Delete or rename `svelte.config.js`/`svelte.config.ts` from the project root","Move its contents into the options object of the `sveltekit(options)` plugin call in `vite.config`","Update tooling/docs that referenced the old config file","Check team scaffolding templates that still generate the file"],"exampleFix":"// before (vite.config.js + svelte.config.js in root)\nexport default defineConfig({ plugins: [sveltekit()] });\n// after\nimport { sveltekit } from '@sveltejs/kit/vite';\nexport default defineConfig({\n  plugins: [sveltekit({ adapter: adapter(), files: { routes: 'src/routes' } })]\n});","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nfor (const f of ['svelte.config.js', 'svelte.config.ts']) {\n  if (existsSync(f)) throw new Error(`${f} must be migrated into the sveltekit() plugin options`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await viteDevServer.listen();\n} catch (err) {\n  if (/is no longer used/.test(err.message)) {\n    console.error('Move svelte.config.js contents into sveltekit() plugin options');\n  }\n  throw err;\n}","preventionTips":["Configure everything through the sveltekit(options) plugin in vite.config","Remove stale svelte.config.js during migrations","Update scaffolding templates that still emit the old config file"],"tags":["config","vite","migration","breaking-change"],"backgroundTag":"deprecated-config-file","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}