{"record":{"id":"7372f74403633b50","repo":"vercel/next.js","slug":"the-default-export-is-not-a-react-component-in","errorCode":null,"errorMessage":"The default export is not a React Component in \"${normalizedPagePath}/${convention}\"","messagePattern":"The default export is not a React Component in \"(.+?)/(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/app-render/create-component-tree.tsx","lineNumber":121,"sourceCode":"/**\n * Variant of createComponentTree for full renders — the initial document\n * (and error) payloads, which are never prefetches. No subtree is cut at a\n * loading boundary, so every node carries its render output, which is what\n * FullTransportNode requires. TypeScript can't see through that invariant,\n * hence the cast.\n */\nexport function createFullComponentTree(\n  props: CreateComponentTreeProps\n): Promise<FullTransportNode> {\n  return createComponentTree(props) as Promise<FullTransportNode>\n}\n\nfunction errorMissingDefaultExport(\n  pagePath: string,\n  convention: string\n): never {\n  const normalizedPagePath = pagePath === '/' ? '' : pagePath\n  throw new Error(\n    `The default export is not a React Component in \"${normalizedPagePath}/${convention}\"`\n  )\n}\n\nconst cacheNodeKey = 'c'\n\nasync function createComponentTreeInternal(\n  {\n    loaderTree: tree,\n    parentParams,\n    parentOptionalCatchAllParamName,\n    rootLayoutIncluded,\n    injectedCSS,\n    injectedJS,\n    injectedFontPreloadTags,\n    ctx,\n    missingSlots,\n    preloadCallbacks,","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/vercel/next.js/blob/43273a1d21a35646ec43230e05727e18ac258396/packages/next/src/server/app-render/create-component-tree.tsx#L103-L139","documentation":"errorMissingDefaultExport is the helper createComponentTreeInternal calls when a route segment file's default export fails the React element-type check while building the App Router component tree. The offending input is the default export of the file at normalizedPagePath/convention (e.g. page.tsx, layout.tsx): it is not a function/class component, so it cannot be rendered as that segment.","triggerScenarios":"Thrown at packages/next/src/server/app-render/create-component-tree.tsx:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the file has a valid React component as its default export.","Check for typos, conditional exports, or accidentally exporting a non-component value as default."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"43273a1d21a35646ec43230e05727e18ac258396","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}