vercel/next.js · error · Error

The default export is not a React Component in page: "${path

Error message

The default export is not a React Component in page: "${pathname}"

What it means

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.

Source

Thrown at packages/next/src/server/render.tsx:620

    throw new Error(
      `getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`
    )
  }

  if (isSSG && pageIsDynamic && !getStaticPaths) {
    throw new Error(
      `getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +
        `\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`
    )
  }

  let asPath: string = renderOpts.resolvedAsPath || (req.url as string)

  if (process.env.__NEXT_DEV_SERVER) {
    const { isValidElementType } =
      require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')
    if (!isValidElementType(Component)) {
      throw new Error(
        `The default export is not a React Component in page: "${pathname}"`
      )
    }

    if (!isValidElementType(App)) {
      throw new Error(
        `The default export is not a React Component in page: "/_app"`
      )
    }

    if (!isValidElementType(Document)) {
      throw new Error(
        `The default export is not a React Component in page: "/_document"`
      )
    }

    if (isAutoExport || isFallback) {
      // remove query values except ones that will be set during export

View on GitHub (pinned to 89d017eac4)

Solutions

  1. Ensure the page file default-exports a valid React component.
  2. Check for syntax errors or accidental non-component default exports.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at packages/next/src/server/render.tsx:622 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@89d017eac4 (2026-08-19). Data as JSON: /api/errors/627c7650c58a1249. Report an issue: GitHub.