{"record":{"id":"627c7650c58a1249","repo":"vercel/next.js","slug":"the-default-export-is-not-a-react-component-in-pag","errorCode":null,"errorMessage":"The default export is not a React Component in page: \"${pathname}\"","messagePattern":"The default export is not a React Component in page: \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/render.tsx","lineNumber":620,"sourceCode":"    throw new Error(\n      `getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`\n    )\n  }\n\n  if (isSSG && pageIsDynamic && !getStaticPaths) {\n    throw new Error(\n      `getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +\n        `\\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`\n    )\n  }\n\n  let asPath: string = renderOpts.resolvedAsPath || (req.url as string)\n\n  if (process.env.__NEXT_DEV_SERVER) {\n    const { isValidElementType } =\n      require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')\n    if (!isValidElementType(Component)) {\n      throw new Error(\n        `The default export is not a React Component in page: \"${pathname}\"`\n      )\n    }\n\n    if (!isValidElementType(App)) {\n      throw new Error(\n        `The default export is not a React Component in page: \"/_app\"`\n      )\n    }\n\n    if (!isValidElementType(Document)) {\n      throw new Error(\n        `The default export is not a React Component in page: \"/_document\"`\n      )\n    }\n\n    if (isAutoExport || isFallback) {\n      // remove query values except ones that will be set during export","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/server/render.tsx#L602-L638","documentation":"Development-server check in renderToHTMLImpl: right before rendering, the page module's default export is tested with React's isValidElementType. When it is not a valid component type (e.g. an object, string, or undefined because the file has no default export), this error names the offending page path. The input at fault is the default export of the page module itself.","triggerScenarios":"Thrown at packages/next/src/server/render.tsx:622 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the page file default-exports a valid React component.","Check for syntax errors or accidental non-component default exports."],"exampleFix":null,"handlingStrategy":"type-guard","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"}