{"record":{"id":"8b21708019dea65b","repo":"vercel/next.js","slug":"the-404-page-can-not-return-notfound-in-getstati","errorCode":null,"errorMessage":"The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!","messagePattern":"The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/render.tsx","lineNumber":1168,"sourceCode":"\n    if ((data as any).unstable_notFound) {\n      throw new Error(\n        `unstable_notFound has been renamed to notFound, please update the field to continue. Page: ${pathname}`\n      )\n    }\n    if ((data as any).unstable_redirect) {\n      throw new Error(\n        `unstable_redirect has been renamed to redirect, please update the field to continue. Page: ${pathname}`\n      )\n    }\n\n    if (invalidKeys.length) {\n      throw new Error(invalidKeysMsg('getServerSideProps', invalidKeys))\n    }\n\n    if ('notFound' in data && data.notFound) {\n      if (pathname === '/404') {\n        throw new Error(\n          `The /404 page can not return notFound in \"getStaticProps\", please remove it to continue!`\n        )\n      }\n\n      metadata.isNotFound = true\n      return new RenderResult(null, {\n        metadata,\n        contentType: null,\n      })\n    }\n\n    if ('redirect' in data && typeof data.redirect === 'object') {\n      checkRedirectValues(data.redirect as Redirect, req, 'getServerSideProps')\n      ;(data as any).props = {\n        __N_REDIRECT: data.redirect.destination,\n        __N_REDIRECT_STATUS: getRedirectStatus(data.redirect),\n      }\n      if (typeof data.redirect.basePath !== 'undefined') {","sourceCodeStart":1150,"sourceCodeEnd":1186,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/server/render.tsx#L1150-L1186","documentation":"Guard in renderToHTMLImpl's data-validation branch: the response object contained notFound: true while the page being rendered is /404 itself. Returning notFound from the 404 page's own data fetching would recurse infinitely, so the validator rejects it and asks for its removal.","triggerScenarios":"Thrown at packages/next/src/server/render.tsx:1170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove `notFound: true` from the /404 page's `getStaticProps`; the 404 page must always be statically renderable."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89d017eac43ebf4742ed2b58d3c1373b70283b69","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}