{"record":{"id":"49fa7db409c5989e","repo":"sveltejs/kit","slug":"event-route-id-is-not-prerenderable","errorCode":null,"errorMessage":"${event.route.id} is not prerenderable","messagePattern":"(.+?) is not prerenderable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/server/endpoint.js","lineNumber":40,"sourceCode":"\tif (!handler) {\n\t\treturn method_not_allowed(mod, method);\n\t}\n\n\tconst prerender = mod.prerender ?? state.prerender_default;\n\n\tif (\n\t\tprerender &&\n\t\t/** @type {import('types').HttpMethod[]} */ (BODY_DEPENDENT_METHODS).some(\n\t\t\t(method) => mod[method]\n\t\t)\n\t) {\n\t\tthrow new Error('Cannot prerender endpoints with body-dependent methods');\n\t}\n\n\tif (state.prerendering && !state.prerendering.inside_reroute && !prerender) {\n\t\tif (state.depth > 0) {\n\t\t\t// if request came from a prerendered page, bail\n\t\t\tthrow new Error(`${event.route.id} is not prerenderable`);\n\t\t} else {\n\t\t\t// if request came direct from the crawler, signal that\n\t\t\t// this route cannot be prerendered, but don't bail\n\t\t\treturn new Response(undefined, { status: 204 });\n\t\t}\n\t}\n\n\ttry {\n\t\tconst response = await with_request_store({ event, state }, () =>\n\t\t\thandler(/** @type {import('@sveltejs/kit').RequestEvent<Record<string, any>>} */ (event))\n\t\t);\n\n\t\tif (!(response instanceof Response)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid response from route ${event.url.pathname}: handler should return a Response object`\n\t\t\t);\n\t\t}\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/server/endpoint.js#L22-L58","documentation":"Crawler-time error in the endpoint renderer: while prerendering, a page that was reached by the crawler (depth > 0) fetched this endpoint, but the endpoint does not opt into prerendering (no `export const prerender` and not covered by the default). Dependencies of a prerendered page must themselves be prerenderable, so the build aborts.","triggerScenarios":"Thrown at packages/kit/src/runtime/server/endpoint.js:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add `export const prerender = true;` to the endpoint module","Set `export const prerender = false;` on the page that depends on it so the page is no longer prerendered","Configure kit.prerender.entries/options to cover the dependency appropriately"],"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"}