{"record":{"id":"74660b0848d46dda","repo":"sveltejs/kit","slug":"no-routes-found-if-you-are-using-a-custom-src-rou","errorCode":null,"errorMessage":"No routes found. If you are using a custom src/routes directory, make sure it is specified in your SvelteKit Vite plugin options","messagePattern":"No routes found\\. If you are using a custom src/routes directory, make sure it is specified in your SvelteKit Vite plugin options","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/sync/create_manifest_data/index.js","lineNumber":375,"sourceCode":"\t\t\t\t\t\tpage_options: null // will be filled later\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// then handle children\n\t\t\tfor (const file of files) {\n\t\t\t\tif (file.is_dir) {\n\t\t\t\t\twalk(depth + 1, path.posix.join(id, file.name), file.name, route);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\twalk(0, '/', '', null);\n\n\t\tif (routes.length === 1) {\n\t\t\tconst root = routes[0];\n\t\t\tif (!root.leaf && !root.error && !root.layout && !root.endpoint) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'No routes found. If you are using a custom src/routes directory, make sure it is specified in your SvelteKit Vite plugin options'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// If there's no routes directory, we'll just create a single empty route. This ensures the root layout and\n\t\t// error components are included in the manifest, which is needed for subsequent build/dev commands to work\n\t\troutes.push({\n\t\t\tid: '/',\n\t\t\tsegment: '',\n\t\t\tpattern: /^$/,\n\t\t\tparams: [],\n\t\t\tparent: null,\n\t\t\tlayout: null,\n\t\t\terror: null,\n\t\t\tleaf: null,\n\t\t\tpage: null,\n\t\t\tendpoint: null","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/sync/create_manifest_data/index.js#L357-L393","documentation":"Thrown after walking the routes directory when only the root route exists and it has no leaf page, error, layout, or endpoint file — i.e. no actual routes were discovered. Almost always means the routes directory location is wrong: SvelteKit is scanning the default src/routes while the app keeps its routes elsewhere and the custom directory was never declared in the SvelteKit Vite plugin options.","triggerScenarios":"Thrown at packages/kit/src/core/sync/create_manifest_data/index.js:375 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point SvelteKit at your routes directory, e.g. sveltekit({ routes: 'src/my-routes' }) in vite.config.js","Move your route files into src/routes","Create at least one route file such as src/routes/+page.svelte"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}