vercel/next.js · error · Error

The default export is not a React Component in "${normalized

Error message

The default export is not a React Component in "${normalizedPagePath}/${convention}"

What it means

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.

Source

Thrown at packages/next/src/server/app-render/create-component-tree.tsx:121

/**
 * Variant of createComponentTree for full renders — the initial document
 * (and error) payloads, which are never prefetches. No subtree is cut at a
 * loading boundary, so every node carries its render output, which is what
 * FullTransportNode requires. TypeScript can't see through that invariant,
 * hence the cast.
 */
export function createFullComponentTree(
  props: CreateComponentTreeProps
): Promise<FullTransportNode> {
  return createComponentTree(props) as Promise<FullTransportNode>
}

function errorMissingDefaultExport(
  pagePath: string,
  convention: string
): never {
  const normalizedPagePath = pagePath === '/' ? '' : pagePath
  throw new Error(
    `The default export is not a React Component in "${normalizedPagePath}/${convention}"`
  )
}

const cacheNodeKey = 'c'

async function createComponentTreeInternal(
  {
    loaderTree: tree,
    parentParams,
    parentOptionalCatchAllParamName,
    rootLayoutIncluded,
    injectedCSS,
    injectedJS,
    injectedFontPreloadTags,
    ctx,
    missingSlots,
    preloadCallbacks,

View on GitHub (pinned to 43273a1d21)

Solutions

  1. Ensure the file has a valid React component as its default export.
  2. Check for typos, conditional exports, or accidentally exporting a non-component value as default.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at packages/next/src/server/app-render/create-component-tree.tsx:121 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@43273a1d21 (2026-08-19). Data as JSON: /api/errors/7372f74403633b50. Report an issue: GitHub.