{"record":{"id":"4404c3b564a50e9f","repo":"withastro/astro","slug":"astro-couldn-t-find-the-correct-page-to-render-pr","errorCode":null,"errorMessage":"Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage. This is an internal error, please file an issue.","messagePattern":"Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage\\. This is an internal error, please file an issue\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/astro/src/core/app/pipeline.ts","lineNumber":119,"sourceCode":"\t\t\t\treturn RedirectSinglePageBuiltModule;\n\t\t\t}\n\t\t} else if (routeIsFallback(route)) {\n\t\t\t// This is an i18n fallback route\n\t\t\trouteToProcess = getFallbackRoute(route, this.manifest.routes);\n\t\t}\n\n\t\tif (this.manifest.pageMap) {\n\t\t\tconst importComponentInstance = this.manifest.pageMap.get(routeToProcess.component);\n\t\t\tif (!importComponentInstance) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unexpectedly unable to find a component instance for route ${route.route}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn await importComponentInstance();\n\t\t} else if (this.manifest.pageModule) {\n\t\t\treturn this.manifest.pageModule;\n\t\t}\n\t\tthrow new Error(\n\t\t\t\"Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage. This is an internal error, please file an issue.\",\n\t\t);\n\t}\n\n\tasync tryRewrite(payload: RewritePayload, request: Request): Promise<TryRewriteResult> {\n\t\tconst { newUrl, pathname, routeData } = findRouteToRewrite({\n\t\t\tpayload,\n\t\t\trequest,\n\t\t\troutes: this.manifest?.routes.map((r) => r.routeData),\n\t\t\ttrailingSlash: this.manifest.trailingSlash,\n\t\t\tbuildFormat: this.manifest.buildFormat,\n\t\t\tbase: this.manifest.base,\n\t\t\toutDir: this.manifest?.serverLike ? this.manifest.buildClientDir : this.manifest.outDir,\n\t\t});\n\n\t\tconst componentInstance = await this.getComponentByRoute(routeData);\n\t\treturn { newUrl, pathname, componentInstance, routeData };\n\t}","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/core/app/pipeline.ts#L101-L137","documentation":"An internal error thrown when the SSR pipeline's manifest has neither a `pageMap` entry for the route's component nor a `pageModule`. This means the built SSR output is malformed — every manifest should have one or the other. The error explicitly says 'this is an internal error, please file an issue.'","triggerScenarios":"`pipeline.getIntegrityMetadata` / `getComponent` is called for a route. The manifest has `pageMap` but it's falsy/empty, and `pageModule` is also falsy. The final `throw new Error(...)` fires after both branches are skipped.","commonSituations":"A corrupted or incomplete build output in `dist/`. An adapter that generates a custom manifest incorrectly omits both `pageMap` and `pageModule`. A build was interrupted and left partial output. An Astro internal bug in manifest generation for a specific project configuration.","solutions":["Delete the `dist/` directory and rebuild (`astro build`).","Ensure you are using a compatible adapter version for your Astro version.","Check that your `astro.config.*` output is set to `server` or `hybrid` as appropriate.","File an Astro issue with your `astro.config.*`, adapter, and Astro version if it persists."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function validateManifest(manifest: any): string[] {\n  const errors: string[] = [];\n  for (const route of manifest?.routes ?? []) {\n    if (!manifest.pageMap?.get(route.routeData.component) && !manifest.pageModule) {\n      errors.push(`Route ${route.routeData.route} has no component mapping`);\n    }\n  }\n  return errors;\n}","typeGuard":"function hasValidPageMapping(manifest: any): boolean {\n  return Boolean(manifest?.pageMap || manifest?.pageModule);\n}","tryCatchPattern":null,"preventionTips":["Always rebuild from clean after upgrading Astro or adapters.","Verify dist/ contains expected page modules before deploying.","Pin adapter versions compatible with your Astro version."],"tags":["ssr","manifest","internal-error","build-output","pipeline"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}