{"record":{"id":"349a658a48ad0295","repo":"sveltejs/kit","slug":"path-relative-process-cwd-user-config-file","errorCode":null,"errorMessage":"${path.relative(process.cwd(), user_config.file)} should extend SvelteKit's built-in configuration:","messagePattern":"(.+?) should extend SvelteKit's built-in configuration:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/core/sync/write_tsconfig/index.js","lineNumber":118,"sourceCode":" * @param {Object} options\n * @param {Record<string, string[]>} options.paths The expected paths\n * @param {string[]} options.types The expected types\n * @param {string[]} [options.exclusions] Files that should be excluded\n * @param {any} options.example What to print if the user config does _not_ extend the generated config\n */\nfunction validate_config(dir, options) {\n\tif (!ts) {\n\t\t// The user has not installed TypeScript. Skip validation of config.\n\t\treturn;\n\t}\n\n\tconst user_config = load_user_tsconfig(dir);\n\tif (!user_config || !modified_since_last_check(user_config.file)) return;\n\n\t// now that we've written the parent config, we can resolve the\n\t// user config and validate that nothing important was overwritten\n\tif (!extends_id(user_config.options, options.example.extends)) {\n\t\tconsole.warn(\n\t\t\tstyleText(\n\t\t\t\t['bold', 'yellow'],\n\t\t\t\t`${path.relative(process.cwd(), user_config.file)} should extend SvelteKit's built-in configuration:`\n\t\t\t)\n\t\t);\n\n\t\tconsole.warn(JSON.stringify(options.example, null, '  '));\n\n\t\treturn;\n\t}\n\n\tconst resolved = ts.parseJsonConfigFileContent(user_config.options, ts.sys, dir);\n\n\tconst warnings = validate_resolved_config(\n\t\tdir,\n\t\tresolved,\n\t\toptions.paths,\n\t\toptions.types,","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/sync/write_tsconfig/index.js#L100-L136","documentation":"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.","triggerScenarios":"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.","commonSituations":"Hand-rolled tsconfig that omits `\"extends\": \"./.svelte-kit/tsconfig.json\"`; migrating from another framework; monorepo setups that overrode extends.","solutions":["Add `\"extends\": \"./.svelte-kit/tsconfig.json\"` to the root tsconfig.json","Run `svelte-kit sync` (or `vite dev`) to regenerate the base config, then restart the dev server","If extending a custom config, make sure it transitively extends .svelte-kit/tsconfig.json"],"exampleFix":"// before (tsconfig.json)\n{ \"compilerOptions\": { \"moduleResolution\": \"bundler\" } }\n// after\n{ \"extends\": \"./.svelte-kit/tsconfig.json\", \"compilerOptions\": {} }","handlingStrategy":"validation","validationCode":"// verify extends before build\nimport { readFileSync } from 'node:fs';\nconst ts = JSON.parse(readFileSync('tsconfig.json', 'utf8'));\nif (!String(ts.extends || '').includes('.svelte-kit/tsconfig.json')) {\n  throw new Error('tsconfig.json must extend ./.svelte-kit/tsconfig.json');\n}","typeGuard":"const extendsSvelteKit = (tsconfig) => typeof tsconfig?.extends === 'string' && tsconfig.extends.includes('.svelte-kit/tsconfig.json');","tryCatchPattern":null,"preventionTips":["Always scaffold with `npx sv create` so extends is present from day one","Never delete the `extends` field when customizing tsconfig","Run `svelte-kit sync` as a prebuild/pretest script"],"tags":["typescript","tsconfig","sync"],"backgroundTag":"tsconfig-missing-extends","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}