{"record":{"id":"929ffd471504a72f","repo":"sveltejs/kit","slug":"files-and-directories-prefixed-with-are-reserved","errorCode":null,"errorMessage":"Files and directories prefixed with + are reserved (saw ${project_relative})","messagePattern":"Files and directories prefixed with \\+ are reserved \\(saw (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/sync/create_manifest_data/index.js","lineNumber":573,"sourceCode":"\t\tif (!match) {\n\t\t\tthrow new Error(`Files prefixed with + are reserved (saw ${project_relative})`);\n\t\t} else if (match[3] || match[6]) {\n\t\t\tthrow new Error(\n\t\t\t\t// prettier-ignore\n\t\t\t\t`Only Svelte files can reference named layouts. Remove '${match[3] || match[6]}' from ${file} (at ${project_relative})`\n\t\t\t);\n\t\t}\n\n\t\tconst kind = match[1] || match[4] || match[7] ? 'server' : 'universal';\n\n\t\treturn {\n\t\t\tkind,\n\t\t\tis_page: !!match[2],\n\t\t\tis_layout: !!match[5]\n\t\t};\n\t}\n\n\tthrow new Error(`Files and directories prefixed with + are reserved (saw ${project_relative})`);\n}\n\n/**\n * @param {string} needle\n * @param {string} haystack\n */\nfunction count_occurrences(needle, haystack) {\n\tlet count = 0;\n\tfor (let i = 0; i < haystack.length; i += 1) {\n\t\tif (haystack[i] === needle) count += 1;\n\t}\n\treturn count;\n}\n","sourceCodeStart":555,"sourceCodeEnd":587,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/sync/create_manifest_data/index.js#L555-L587","documentation":"This is the final fallback in analyze(): any `+`-prefixed file or directory in src/routes that is neither a recognized Svelte component nor a recognized JS/TS module is rejected. SvelteKit reserves the entire `+` namespace under routes, so a +node_modules dir, +assets folder, or +README.md will abort sync with this message.","triggerScenarios":"A `+`-prefixed path in src/routes that matches no component or module pattern: directories like +components/, files like +notes.md, +data.json, or +helpers.js (unrecognized base name).","commonSituations":"Folders starting with + such as +stash/ or +backups/ inside routes; dependency output accidentally written into src/routes with a + prefix; users inventing files like +store.js expecting special behavior.","solutions":["Rename the file/directory so it does not start with `+`, or move it out of src/routes.","Use the documented reserved names only (+page, +layout, +error, +server with allowed extensions).","Store shared code outside src/routes (e.g. src/lib) rather than prefixing with `+`."],"exampleFix":"// before\nsrc/routes/+components/Button.svelte\n// after\nsrc/lib/components/Button.svelte","handlingStrategy":"validation","validationCode":"for (const entry of fs.readdirSync('src/routes', { recursive: true })) {\n  if (path.basename(String(entry)).startsWith('+') && !/^\\+(page|layout|error|server)(\\..+)?$/.test(path.basename(String(entry)))) {\n    throw new Error(`Reserved + prefix on non-route entry: ${entry}`);\n  }\n}","typeGuard":"function isReservedRouteEntry(basename) {\n  return basename.startsWith('+');\n}","tryCatchPattern":"null","preventionTips":["Never name files or folders with a leading + anywhere under src/routes.","Keep backups, notes, and helpers in src/lib or outside the routes tree.","Add a pre-commit check that flags + prefixed unknown entries in routes."],"tags":["sveltekit","routing","file-naming","sync"],"backgroundTag":"reserved-file-name-conflict","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}