{"record":{"id":"3493fb35cc6f104f","repo":"withastro/astro","slug":"astro-couldn-t-find-the-correct-page-to-render-pr-3493fb","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/base-pipeline.ts","lineNumber":431,"sourceCode":"\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif (route.type === 'redirect') {\n\t\t\treturn RedirectSinglePageBuiltModule;\n\t\t} else {\n\t\t\tif (this.manifest.pageMap) {\n\t\t\t\tconst importComponentInstance = this.manifest.pageMap.get(route.component);\n\t\t\t\tif (!importComponentInstance) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Unexpectedly unable to find a component instance for route ${route.route}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn await importComponentInstance();\n\t\t\t} else if (this.manifest.pageModule) {\n\t\t\t\treturn this.manifest.pageModule;\n\t\t\t}\n\t\t\tthrow new Error(\n\t\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\t);\n\t\t}\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface HeadElements extends Pick<SSRResult, 'scripts' | 'styles' | 'links'> {}\n\nexport interface TryRewriteResult {\n\trouteData: RouteData;\n\tcomponentInstance: ComponentInstance;\n\tnewUrl: URL;\n\tpathname: string;\n}\n","sourceCodeStart":413,"sourceCodeEnd":447,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/core/base-pipeline.ts#L413-L447","documentation":"An internal error thrown when the base pipeline's `getModuleForRoute` cannot find a component instance for a route because the manifest has neither a `pageMap` with the route's component nor a `pageModule`. Identical in cause to error 113 but thrown from `base-pipeline.ts` rather than `pipeline.ts`. This indicates malformed SSR build output or an adapter misconfiguration.","triggerScenarios":"`getModuleForRoute(route)` is called. The manifest's `pageMap` exists but doesn't contain `route.component` (or `pageMap` is absent), and `pageModule` is also absent/falsy. The final `throw new Error(...)` fires with the 'internal error' message.","commonSituations":"A corrupted `dist/` from an interrupted build. An adapter generates a manifest without proper page mappings. Astro version mismatch between core and adapter. A route was added but the build output wasn't regenerated. Custom manifest manipulation by an integration.","solutions":["Delete `dist/` and run `astro build` fresh.","Verify your adapter is compatible with your Astro version.","Ensure all routes are valid `.astro` pages or endpoints.","Remove custom integrations that modify the manifest and rebuild.","File an Astro issue if the error persists with a minimal reproduction."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function validateManifestRoutes(manifest: any): string[] {\n  const errors: string[] = [];\n  if (!manifest.pageMap && !manifest.pageModule) {\n    errors.push('Manifest has no pageMap or pageModule — rebuild required');\n  }\n  return errors;\n}","typeGuard":"function manifestHasPageMapping(manifest: any): boolean {\n  return Boolean(manifest?.pageMap || manifest?.pageModule);\n}","tryCatchPattern":null,"preventionTips":["Rebuild from a clean dist/ directory after any config or adapter change.","Pin adapter and Astro versions to known-compatible releases.","Run a smoke test of the SSR server before deploying to production."],"tags":["ssr","manifest","internal-error","build-output","base-pipeline"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}