{"record":{"id":"346f79b267226326","repo":"sveltejs/kit","slug":"multiple-endpoint-files-found-in-routes-base-r","errorCode":null,"errorMessage":"Multiple endpoint files found in ${routes_base}${route.id} : ${path.basename(existing_file)} and ${file.name}","messagePattern":"Multiple endpoint files found in (.+?)(.+?) : (.+?) and (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/core/sync/create_manifest_data/index.js","lineNumber":352,"sourceCode":"\t\t\t\t\t\t\t/** @type {string} */ (route.layout[item.kind])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\troute.layout[item.kind] = project_relative;\n\t\t\t\t} else if (item.is_page) {\n\t\t\t\t\tif (!route.leaf) {\n\t\t\t\t\t\troute.leaf = { depth };\n\t\t\t\t\t} else if (route.leaf[item.kind]) {\n\t\t\t\t\t\tthrow duplicate_files_error(\n\t\t\t\t\t\t\titem.kind + ' page module',\n\t\t\t\t\t\t\t/** @type {string} */ (route.leaf[item.kind])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\troute.leaf[item.kind] = project_relative;\n\t\t\t\t} else {\n\t\t\t\t\tif (route.endpoint) {\n\t\t\t\t\t\tthrow duplicate_files_error('endpoint', route.endpoint.file);\n\t\t\t\t\t}\n\n\t\t\t\t\troute.endpoint = {\n\t\t\t\t\t\tfile: project_relative,\n\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);","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/core/sync/create_manifest_data/index.js#L334-L370","documentation":"Route-tree validation while walking src/routes: a directory already had an endpoint file registered (route.endpoint set), and another endpoint candidate (e.g. a second +server.js under a different module extension like .js/.ts) was found in the same route. SvelteKit allows at most one endpoint per route; duplicate_files_error normally formats this, and the walk throws naming both conflicting files.","triggerScenarios":"Thrown at packages/kit/src/core/sync/create_manifest_data/index.js:352 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete one of the two endpoint files, keeping a single +server.* per route directory","Avoid mixing module extensions for the same route file, e.g. +server.js and +server.ts in one directory"],"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"}