Skip to content

Setting kit.files.src results in deprecation message #14205

@luislavena

Description

@luislavena

Describe the bug

Hello folks,

Made a fresh sv create my-app using Bun and ended with the following versions:

# bun pm ls
/workspace/exp-svelte-demo node_modules (101)
├── @fontsource/[email protected]
├── @neoconfetti/[email protected]
├── @sveltejs/[email protected]
├── @sveltejs/[email protected]
├── @sveltejs/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Following #14152, wanted to test placing all SvelteKit files in src/frontend (to co-exists with another codebase):

import adapter from "@sveltejs/adapter-auto";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: vitePreprocess(),

  kit: {
    adapter: adapter(),
    files: {
      src: "src/frontend",
    },
  },
};

export default config;

When bun run dev, got the following in the terminal:

The `config.kit.files.src` option is deprecated, and will be removed in a future version

Looking at the changes done in #14152, specially the fixture config file:

https://github.com/sveltejs/kit/pull/14152/files#diff-da2134357ccc2d30bee7b3618668fc1fb012eca2c53ee6dc46339a3345c8819e

export default {
	kit: {
		files: {
			src: 'source'
		}
	}
};

Appears to be doing the exact same configuration, yet this generates the warning.

Looking to the other changes, I saw a deprecate on the new src usage:

https://github.com/sveltejs/kit/pull/14152/files#diff-1411a71a2bbcac1c2a0277a836799b279873cf32e82c52ad9aca3c66307ca229

			files: object({
				src: deprecate(string('src')),
				assets: deprecate(string('static')),
				hooks: object({
					client: deprecate(string(null)),
					server: deprecate(string(null)),
					universal: deprecate(string(null))
				}),
				lib: deprecate(string(null)),
				params: deprecate(string(null)),
				routes: deprecate(string(null)),
				serviceWorker: deprecate(string(null)),
				appTemplate: deprecate(string(null)),
				errorTemplate: deprecate(string(null))
			}),

But makes no sense to deprecate the freshly added option.

I might be missing something or this deprecation warning is an error?

Thank you in advance and apologies if I've missed something in the linked issues 🙏
❤️ ❤️ ❤️

Reproduction

  • bunx sv create-app my-app
  • mv src frontend
  • mkdir -p src
  • mv frontend src/
  • Edit svelte.config.js with kit.files.src as src/frontend
  • bun run dev

Logs

The `config.kit.files.src` option is deprecated, and will be removed in a future version

System Info

* Alpine Linux 3.22.1 (aarch64)
* Bun 1.2.20
* Svelte 5.38.1
* SvelteKit 2.29.1
* Vite 7.1.2

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions