sveltejs/kit · warning

${path.relative(process.cwd(), user_config.file)} should ext

Error message

${path.relative(process.cwd(), user_config.file)} should extend SvelteKit's built-in configuration:

What it means

In write_tsconfig validation, SvelteKit warns when the user's tsconfig.json does not extend the generated `.svelte-kit/tsconfig.json`, which is required for proper module resolution and compiler options. The check runs during `svelte-kit sync` when the tsconfig changed since the last check.

Source

Thrown at packages/kit/src/core/sync/write_tsconfig/index.js:118

 * @param {Object} options
 * @param {Record<string, string[]>} options.paths The expected paths
 * @param {string[]} options.types The expected types
 * @param {string[]} [options.exclusions] Files that should be excluded
 * @param {any} options.example What to print if the user config does _not_ extend the generated config
 */
function validate_config(dir, options) {
	if (!ts) {
		// The user has not installed TypeScript. Skip validation of config.
		return;
	}

	const user_config = load_user_tsconfig(dir);
	if (!user_config || !modified_since_last_check(user_config.file)) return;

	// now that we've written the parent config, we can resolve the
	// user config and validate that nothing important was overwritten
	if (!extends_id(user_config.options, options.example.extends)) {
		console.warn(
			styleText(
				['bold', 'yellow'],
				`${path.relative(process.cwd(), user_config.file)} should extend SvelteKit's built-in configuration:`
			)
		);

		console.warn(JSON.stringify(options.example, null, '  '));

		return;
	}

	const resolved = ts.parseJsonConfigFileContent(user_config.options, ts.sys, dir);

	const warnings = validate_resolved_config(
		dir,
		resolved,
		options.paths,
		options.types,

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Add `"extends": "./.svelte-kit/tsconfig.json"` to the root tsconfig.json
  2. Run `svelte-kit sync` (or `vite dev`) to regenerate the base config, then restart the dev server
  3. If extending a custom config, make sure it transitively extends .svelte-kit/tsconfig.json

Example fix

// before (tsconfig.json)
{ "compilerOptions": { "moduleResolution": "bundler" } }
// after
{ "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": {} }
Defensive patterns

Strategy: validation

Validate before calling

// verify extends before build
import { readFileSync } from 'node:fs';
const ts = JSON.parse(readFileSync('tsconfig.json', 'utf8'));
if (!String(ts.extends || '').includes('.svelte-kit/tsconfig.json')) {
  throw new Error('tsconfig.json must extend ./.svelte-kit/tsconfig.json');
}

Type guard

const extendsSvelteKit = (tsconfig) => typeof tsconfig?.extends === 'string' && tsconfig.extends.includes('.svelte-kit/tsconfig.json');

Prevention

When it happens

Trigger: tsconfig.json has an `extends` field that does not resolve to `.svelte-kit/tsconfig.json` (missing, removed, or pointing elsewhere), detected by `extends_id` after sync writes the parent config.

Common situations: Hand-rolled tsconfig that omits `"extends": "./.svelte-kit/tsconfig.json"`; migrating from another framework; monorepo setups that overrode extends.

Related errors


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