{"record":{"id":"0d0ccbc115257b09","repo":"sveltejs/kit","slug":"each-member-of-keypath-must-start-with-sa","errorCode":null,"errorMessage":"Each member of ${keypath} must start with '.' — saw '${extension}'","messagePattern":"Each member of (.+?) must start with '\\.' — saw '(.+?)'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/config/options.js","lineNumber":132,"sourceCode":"\t\t\tinstrumentation: removed(\n\t\t\t\t(keypath) =>\n\t\t\t\t\t`\\`${keypath}\\` has been removed. \\`src/instrumentation.server.js\\` is now included in the build automatically when it exists; no opt-in is required`\n\t\t\t),\n\t\t\tremoteFunctions: boolean(false),\n\t\t\tforkPreloads: boolean(false),\n\t\t\thandleRenderingErrors: removed()\n\t\t},\n\t\ttrue\n\t),\n\n\textensions: validate(['.svelte'], (input, keypath) => {\n\t\tif (!Array.isArray(input) || !input.every((page) => typeof page === 'string')) {\n\t\t\tthrow new Error(`${keypath} must be an array of strings`);\n\t\t}\n\n\t\tinput.forEach((extension) => {\n\t\t\tif (extension[0] !== '.') {\n\t\t\t\tthrow new Error(`Each member of ${keypath} must start with '.' — saw '${extension}'`);\n\t\t\t}\n\n\t\t\tif (!/^(\\.[a-z0-9]+)+$/i.test(extension)) {\n\t\t\t\tthrow new Error(`File extensions must be alphanumeric — saw '${extension}'`);\n\t\t\t}\n\t\t});\n\n\t\treturn input;\n\t}),\n\n\tfiles: object({\n\t\tsrc: string('src'),\n\t\tassets: string('static'),\n\t\thooks: object({\n\t\t\tclient: string(null),\n\t\t\tserver: string(null),\n\t\t\tuniversal: string(null)\n\t\t}),","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/config/options.js#L114-L150","documentation":"Config validation error from SvelteKit's options validator for the `extensions` field. Each entry (e.g. '.svelte') must begin with a dot so the framework can match route/component files by extension; this fires during config validation when a user supplies an extension string like 'svelte' without the leading '.'.","triggerScenarios":"Config like `extensions: ['svelte']` or `extensions: ['.svelte', 'svx']` — any member whose first character is not `.`.","commonSituations":"Writing extension names without leading dots in svelte.config.js; reading extension names from filenames (e.g. `file.name.split('.').pop()` yields `svelte` without a dot).","solutions":["Add a leading dot to each extension: `'svelte'` becomes `'.svelte'`","Normalize programmatically: `list.map((e) => e.startsWith('.') ? e : '.' + e)` before assigning"],"exampleFix":"// before\nexport default { extensions: ['svelte', 'svx'] };\n// after\nexport default { extensions: ['.svelte', '.svx'] };","handlingStrategy":"validation","validationCode":"for (const ext of config.extensions ?? []) {\n  if (typeof ext !== 'string' || !ext.startsWith('.')) {\n    throw new Error(`Extension '${ext}' must start with '.'`);\n  }\n}","typeGuard":"function hasLeadingDot(v) {\n  return Array.isArray(v) && v.every((e) => typeof e === 'string' && e.startsWith('.'));\n}","tryCatchPattern":"try {\n  normalizeExtensions(config.extensions);\n} catch (e) {\n  if (String(e.message).includes(\"must start with '.'\")) {\n    console.error('Add a leading dot to each extension');\n  }\n  throw e;\n}","preventionTips":["Normalize extension inputs with `e.startsWith('.') ? e : '.' + e` before assigning","Keep a lint rule or unit test asserting the shape of `extensions`","When splitting filenames to extract extensions, re-prepend the dot"],"tags":["config","validation","sveltekit"],"backgroundTag":"invalid-config-value","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}