{"record":{"id":"06f1578415e41da8","repo":"gatsbyjs/gatsby","slug":"page-template-details-for-page-componentchunkna","errorCode":null,"errorMessage":"Page template details for \"${page.componentChunkName}\" not found","messagePattern":"Page template details for \"(.+?)\" not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/utils/page-ssr-module/entry.ts","lineNumber":160,"sourceCode":"        )\n        findMetaActivity.start()\n      }\n      potentialPagePath = getPagePathFromPageDataPath(pathName) || pathName\n\n      // 1. Find a page for pathname\n      const maybePage = findEnginePageByPath(potentialPagePath)\n\n      if (!maybePage) {\n        // page not found, nothing to run query for\n        throw new Error(`Page for \"${pathName}\" not found`)\n      }\n\n      page = maybePage\n\n      // 2. Lookup query used for a page (template)\n      templateDetails = INLINED_TEMPLATE_TO_DETAILS[page.componentChunkName]\n      if (!templateDetails) {\n        throw new Error(\n          `Page template details for \"${page.componentChunkName}\" not found`\n        )\n      }\n    } finally {\n      if (findMetaActivity) {\n        findMetaActivity.end()\n      }\n    }\n\n    const executionPromises: Array<Promise<any>> = []\n\n    // 3. Execute query\n    // query-runner handles case when query is not there - so maybe we should consider using that somehow\n    let results: IExecutionResult = {}\n    let serverData: IServerData | undefined\n    if (templateDetails.query) {\n      let runningQueryActivity: MaybePhantomActivity\n      if (getDataWrapperActivity) {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/utils/page-ssr-module/entry.ts#L142-L178","documentation":"Thrown in `getData` after a page is found but its `componentChunkName` is missing from the `INLINED_TEMPLATE_TO_DETAILS` map. That map registers the compiled page template (query + component metadata) inlined into the page-ssr engine bundle. A miss means the page-ssr engine and the page-state store disagree: the page exists in the data store but its template was not bundled/inlined.","triggerScenarios":"A page is registered in the datastore with a `componentChunkName` whose template was not inlined into the page-ssr bundle during the same build. Happens when `.cache/page-ssr` is rebuilt but the datastore is stale, when a plugin mutates `componentChunkName` after template inlining, or when serving a build whose page-ssr bundle predates newly added pages.","commonSituations":"Mixing outputs from two different `gatsby build` runs (datastore from one, page-ssr from another); upgrading Gatsby across a version that changed template-inlining without clearing `.cache`; a plugin that overrides `componentChunkName` to a value never registered with the SSR engine.","solutions":["Wipe the cache and rebuild from scratch: `rm -rf .cache public && gatsby build`.","Confirm the deployment ships the `.cache` directory (page-ssr bundle + datastore) from the same build run.","Audit plugins that touch page components or `componentChunkName` for incompatibility with the current Gatsby version.","Re-pin to a known-good Gatsby patch version if the error appeared after an upgrade."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// CI check: assert every page's componentChunkName is in the inlined template set\nconst missing = pages.filter(p => !templateDetailsByChunk[p.componentChunkName])\nif (missing.length) throw new Error('Stale cache: rebuild .cache/page-ssr')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always rebuild `.cache` and `public` together; never mix artifacts from separate builds.","Pin a single Gatsby version across build and serve environments.","Avoid plugins that mutate `componentChunkName`."],"tags":["ssr","dsg","page-template","cache","engine-bundle"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}