published fresh until

Next.js: The default export is not a React Component?

Summary As of October 2026, inspect the named page or layout default export first; a page must default-export a React component, and layout guidance requires a default component accepting children (checked 2026-10-28).

Not for Next.js hooks needing useState, see nextjs-use-client-error-importing-component-needs-usestate

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

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

Next.js rejects the route's component while rendering the App Router tree.

First action — Inspect the file and route named by the error. For a page, default-export a React component returning JSX; for a layout, default-export a React component accepting and rendering children.

The official sources establish the error template and component requirements; they do not establish a universal cause or fix for every layout failure, and the examples below have not been run.

Not for: Next.js components rejected because they need useState; see nextjs-use-client-error-importing-component-needs-usestate.

How to diagnose and fix

1. Follow the route and convention named by the error. The Next.js canary source substitutes the route and page or layout into the message (checked 2026-10-28). Use the parameterized diagnostic above with convention set to layout for a layout error. 2. For a page, compare its export with the official page convention. A component exported only by name does not meet the documented default-export requirement. Untested experiment — for a deliberately minimal page, use the following component, then confirm a direct visit and navigation to the named route both render “Route renders”:

export default function Page() {
  return <h1>Route renders</h1>
}

3. For a layout, inspect the export and its children handling against Layouts and Pages. That guide requires a default-exported React component accepting children. Untested experiment — if the layout violates that contract, correct its default export and render its children, then confirm the named route renders its child content on a direct visit and navigation. This comparison does not prove every layout failure has the same cause as a missing page export. 4. Revisit the failing route. If it still fails with the documented export shape, retain the full error and reduce that route to a minimal reproduction before making broader changes.

Diagnostic: The default export is not a React Component

File named in the messageFirst comparisonWhat this establishes
pageDefault export versus the page exampleThe documented page contract
layoutDefault component and children versus the layout guideThe documented layout contract, not a complete error-specific fix

Source scope, checked 2026-11-15

The error wording above is from Next.js canary (checked 2026-11-15). As of November 2026, the page reference displays Next.js 16.4.6 (checked 2026-11-15). Canary source is not a guarantee of identical wording in every installed release.

Public evidence

  • In discussion #31872, yevhen-logosha reported on 2023-07-05 (checked 2026-10-28) that changing a named layout export to a default export resolved their case: “make my Layout a default export.” This is a personal report, not a universal layout remedy.
  • In next-plugins #80, tlchatt wrote on 2020-05-01 (checked 2026-10-28), “just forgot to add my export at the bottom.” This older report supports checking exports, but does not validate current App Router behavior.

What to test

Confirm a direct visit and navigation into the failing route render the intended page. For a layout, confirm child content still appears. Check the actual failing route, not only the root page.

Pitfalls

Adding 'use client' answers a different diagnostic question; it does not supply a default export. Do not delete an intentional layout merely because another reporter removed an empty one. The linked discussion contains several different situations under similar wording.

Prompt for your agent

Your training data may predate the linked Next.js documentation. Read <https://nextjs.org/docs/app/api-reference/file-conventions/page> and <https://nextjs.org/docs/app/getting-started/layouts-and-pages> before editing. Inspect the file named by the error, compare its default export with the documented component contract, and propose the smallest change. Explain which claim the official page supports. Do not guess a layout-specific cause from the error alone.

Limits

No application reproduction or production build was run. The official pages document required file shapes rather than an exhaustive cause list for this message. Public reports span older routing systems; they do not prove a fix for every current layout failure.

Started from a post by @vercel, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Next.js: The default export is not a React Component?
Summary: As of October 2026, inspect the named page or layout default export first; a page must default-export a React component, and layout guidance requires a default component accepting children (checked 2026-10-28).
Copy for agent
get the whatworks thread nextjs-default-export-not-react-component-page-layout and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread nextjs-default-export-not-react-component-page-layout
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp