{"record":{"id":"a0934eef7dd0b13b","repo":"gatsbyjs/gatsby","slug":"html-body-h1-404-h1-p-not-found-p-body-h","errorCode":null,"errorMessage":"<html><body><h1>404</h1><p>Not found</p></body></html>","messagePattern":"<html><body><h1>404</h1><p>Not found</p></body></html>","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"packages/gatsby/src/utils/page-ssr-module/lambda.ts","lineNumber":507,"sourceCode":"  req: GatsbyFunctionRequest,\n  res: GatsbyFunctionResponse\n): Promise<void> {\n  try {\n    let pageInfo: IPageInfo | undefined\n\n    const originalPathName = req.url ?? ``\n\n    if (PATH_PREFIX && originalPathName.startsWith(PATH_PREFIX)) {\n      const maybePath = originalPathName.slice(PATH_PREFIX.length)\n      pageInfo = getPage(maybePath)\n    }\n\n    if (!pageInfo) {\n      pageInfo = getPage(originalPathName)\n    }\n\n    if (!pageInfo) {\n      res.status(404).send(getErrorBody(404))\n      return\n    }\n\n    const { pagePath, isPageData, page } = pageInfo\n\n    const data = await getData({\n      pathName: pagePath,\n      getGraphqlEngine: () =>\n        memoizedInitializeGraphqlEngine(\n          req?.rawUrl ? new URL(req.rawUrl).origin : cdnDatastoreOrigin\n        ),\n      req,\n    })\n\n    if (isPageData) {\n      const results = await renderPageData({ data })\n      setStatusAndHeaders({ page, data, res })\n      res.json(results)","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8cffb8f412653a717042ec4de85038b4f2edd5e8/packages/gatsby/src/utils/page-ssr-module/lambda.ts#L489-L525","documentation":"engineHandler resolves the request path against the page manifest (honoring PATH_PREFIX); no matching page or page-data route yields this HTML 404 body sent with status 404. It is the SSR engine's terminal response for unknown routes, not an exception.","triggerScenarios":"Thrown at packages/gatsby/src/utils/page-ssr-module/lambda.ts:489 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a page (or 404 page) for the requested route","Check pathPrefix configuration if routes are missing their prefix","Verify the routes manifest includes the path"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cffb8f412653a717042ec4de85038b4f2edd5e8","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}