{"record":{"id":"6f254f63a6e61bd7","repo":"vercel/next.js","slug":"getdisplayname-app-getinitialprops-should","errorCode":null,"errorMessage":"\"${getDisplayName(App)}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.","messagePattern":"\"(.+?)\\.getInitialProps\\(\\)\" should resolve to an object\\. But found \"(.+?)\" instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/shared/lib/utils.ts","lineNumber":409,"sourceCode":"      // @ts-ignore pageProps default\n      return {\n        pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx),\n      }\n    }\n    return {} as IP\n  }\n\n  const props = await App.getInitialProps(ctx)\n\n  if (res && isResSent(res)) {\n    return props\n  }\n\n  if (!props) {\n    const message = `\"${getDisplayName(\n      App\n    )}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`\n    throw new Error(message)\n  }\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (Object.keys(props).length === 0 && !ctx.ctx) {\n      console.warn(\n        `${getDisplayName(\n          App\n        )} returned an empty object from \\`getInitialProps\\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`\n      )\n    }\n  }\n\n  return props\n}\n\nexport const SP = typeof performance !== 'undefined'\nexport const ST =\n  SP &&","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/shared/lib/utils.ts#L391-L427","documentation":"Thrown by loadGetInitialProps after awaiting App.getInitialProps(ctx): the resolved value was falsy (null or undefined) rather than a plain object. The input at fault is whatever the app's (or page's) getInitialProps returned — typically a missing return statement — so the props object the renderer needs does not exist.","triggerScenarios":"App.getInitialProps resolves to a non-object value.","commonSituations":"Returning null, a promise of a primitive, or forgetting to return from getInitialProps.","solutions":["Return a plain object from getInitialProps."],"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"}