{"record":{"id":"f7dbf358c615901b","repo":"vercel/next.js","slug":"detected-getinitialprops-on-page-pathname-whi","errorCode":null,"errorMessage":"Detected getInitialProps on page '${pathname}' while running export. It's recommended to use getStaticProps which has a more correct behavior for static exporting.\nRead more: https://nextjs.org/docs/messages/get-initial-props-export","messagePattern":"Detected getInitialProps on page '(.+?)' while running export\\. It's recommended to use getStaticProps which has a more correct behavior for static exporting\\.\nRead more: https://nextjs\\.org/docs/messages/get-initial-props-export","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/render.tsx","lineNumber":550,"sourceCode":"  const defaultAppGetInitialProps =\n    App.getInitialProps === (App as any).origGetInitialProps\n\n  const hasPageGetInitialProps = !!(Component as any)?.getInitialProps\n  const hasPageScripts = (Component as any)?.unstable_scriptLoader\n\n  const pageIsDynamic = isDynamicRoute(pathname)\n\n  const defaultErrorGetInitialProps =\n    pathname === '/_error' &&\n    (Component as any).getInitialProps ===\n      (Component as any).origGetInitialProps\n\n  if (\n    renderOpts.isBuildTimePrerendering &&\n    hasPageGetInitialProps &&\n    !defaultErrorGetInitialProps\n  ) {\n    warn(\n      `Detected getInitialProps on page '${pathname}'` +\n        ` while running export. It's recommended to use getStaticProps` +\n        ` which has a more correct behavior for static exporting.` +\n        `\\nRead more: https://nextjs.org/docs/messages/get-initial-props-export`\n    )\n  }\n\n  let isAutoExport =\n    !hasPageGetInitialProps &&\n    defaultAppGetInitialProps &&\n    !isSSG &&\n    !getServerSideProps\n\n  // if we are running from experimental compile and the page\n  // would normally be automatically statically optimized\n  // ensure we set cache header so it's not rendered on-demand\n  // every request\n  if (isAutoExport && !process.env.__NEXT_DEV_SERVER && isExperimentalCompile) {","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/server/render.tsx#L532-L568","documentation":"Error \"Detected getInitialProps on page '${pathname}' while running export. It's recommended to use getStaticProps which has a more correct behavior for static exporting.\nRead more: https://nextjs.org/docs/messages/get-initial-props-export\" thrown in vercel/next.js.","triggerScenarios":"Thrown at packages/next/src/server/render.tsx:552 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace getInitialProps with getStaticProps (and getStaticPaths for dynamic pages) for static export compatibility."],"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"}