The default export is not a React Component in page
A page module resolved its default export to an object or a promise. Check the export shape, barrel files, async client components and HOC wrappers.

Introduction & Quick Summary
Error: The default export is not a React Component in page: "/dashboard"Next.js rendered a route, imported its module, read default, and found something that is not a component: undefined, a plain object, a string, a number, or a promise. The route was matched correctly, so the error is not about routing. It is about what the module exports.
The five causes, in the order they actually happen:
- The export is missing or renamed.
export function Page()withoutdefault, orexport default pagewhere the identifier does not exist, leavesdefaultundefined. export defaultpoints at a config object. A Next.js metadata object, a typed routes constant, or adynamicconfig exported as default instead of named, is not callable.- An
asyncclient component. In the App Router anasyncfunction marked"use client"resolves to a promise, which is not a valid component type. - A barrel file re-exports the wrong binding.
export { default } from "./Dashboard"fails whenDashboard.tsxexports only named components. - A wrapper returned a value instead of a component.
export default withAuth(Dashboard)wherewithAuthcalls the component immediately rather than returning a function.
| Message variant | Meaning | Typical fix |
|---|---|---|
default export is not a React Component in page | default is not function/class/forwardRef | Export a component as default |
The default export is not a React Component in page: "/" | Same, with route in App Router | Check the page file for that route |
Element type is invalid: expected a string ... but got: object | Runtime equivalent in React | Look for a bad re-export |
Type error: Page ... does not match the required types | Type layer catching the same bug | Align the export signature |
| Build passes, runtime fails | Component resolved through a dynamic import | Check the import path and default interop |
Core Mechanics, Signatures & Reproducible Setup
A page module contract is narrow. In the App Router, page.tsx must default-export a function or class that React can instantiate, optionally accepting params and searchParams props (both promises in Next.js 15 and later). In the Pages Router, pages/*.tsx must default-export a component, and named exports such as getServerSideProps are read separately.
A minimal reproduction is one file that exports an object:
// app/dashboard/page.tsx
const config = { title: "Dashboard" };
export default config;next dev
# Error: The default export is not a React Component in page: "/dashboard"The fix is to export a component and move the data to metadata:
// app/dashboard/page.tsx
import type { Metadata } from "next";
export const metadata: Metadata = { title: "Dashboard" };
export default function DashboardPage() {
return <main>Dashboard</main>;
}An async client component reproduces the same failure in a subtler way:
"use client";
export default async function Page() {
const res = await fetch("/api/me");
return <div>{res.status}</div>;
}Error: The default export is not a React Component in page: "/account"Keep the client component synchronous and fetch in an effect, or move the await into a server component and pass data down:
// app/account/page.tsx (server component, no "use client")
import AccountView from "./AccountView";
export default async function Page() {
const res = await fetch("https://api.example.com/me", { cache: "no-store" });
const user = await res.json();
return <AccountView user={user} />;
}The fastest way to see what is actually exported is a one-line probe in the module:
console.log(typeof (await import("./app/dashboard/page")).default);Key Comparison Table
| Export shape | Valid page default? | What Next.js sees | Outcome |
|---|---|---|---|
export default function Page() {} | Yes | Function | Renders |
export default class Page extends React.Component | Yes | Class | Renders |
export default async function Page() (server) | Yes | Async function | Renders |
export default async function Page() with "use client" | No | Promise when called | This error |
export default { title } | No | Object | This error |
export function Page() | No | default undefined | This error |
export default memo(Page) | Yes | Object with $$typeof | Renders |
| Router | File convention | Extra requirement |
|---|---|---|
| App Router | app/**/page.tsx | Props are promises from Next.js 15 |
| Pages Router | pages/**/*.tsx | No App Router directives allowed |
| Layout | app/**/layout.tsx | Must accept and render children |
| Route handler | app/**/route.ts | Must export HTTP verbs, not a component |
| Error boundary | error.tsx | Must be a client component |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
Case 1: A route file that should be a handler
Putting component code in route.ts produces the mirror-image error, and putting handler code in page.tsx produces this one.
// app/api/health/route.ts
export async function GET() {
return Response.json({ ok: true });
}If the file is named page.tsx it must return JSX, so keep handler and page files separate.
Case 2: Default and named mixed up in a barrel
// components/index.ts
export { Dashboard } from "./Dashboard"; // named only// app/dashboard/page.tsx
export { default } from "@/components"; // no default existsRe-export the exact binding or import the named component and export it:
import { Dashboard } from "@/components";
export default Dashboard;Case 3: An HOC that calls instead of wraps
// broken
const withAuth = (Component) => Component();
// correct
const withAuth = (Component) => {
function Wrapped(props) {
return <Component {...props} />;
}
return Wrapped;
};A HOC that invokes the component returns its output, which may be a promise or an element, neither of which is a component type.
Case 4: Interop with a CommonJS package
import Chart from "legacy-chart"; // module.exports = { default: ... }Depending on the bundler and esModuleInterop, default can land on .default.default. Check what the module really exposes:
node -e "const m=require('legacy-chart'); console.log(Object.keys(m), typeof m)"Normalize at the edge with a small adapter rather than changing compiler flags for the whole app.
Case 5: A dynamic import returning the namespace
const Page = dynamic(() => import("./Page")); // fine: dynamic unwraps default
const Page = dynamic(() => import("./Page").then((m) => m)); // namespace objectReturning the whole namespace gives Next.js an object, so return m.default explicitly when the module has no default export helper.
Case 6: params typed as a plain object in Next.js 15+
The error message changed shape but the class of failure is the same: the module's contract no longer matches. Await the props:
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
return <div>{id}</div>;
}Common Compilation/Runtime Mistakes & Version Gotchas
export defaulton an arrow with a type assertion.export default (() => null) as unknown as SomeTypecan erase the callable type at build time and still resolve to a non-component at runtime. Prefer plain function declarations for pages.- Fast Refresh hiding it. Editing a page can leave a stale module in the dev server when the export changes shape. Restart
next devbefore debugging further; a rebuild that suddenly works is evidence of staleness. - Server Actions and pages in one file. A file with
"use server"at the top cannot also default-export a component. Split them. next/dynamicwithssr: falseinside a server component. Next.js 15 rejects this combination, and the error surfaces near the same import path. Move the dynamic import into a client component.- Typed routes. With
typedRoutesenabled, a wrong default export can surface as a type error before runtime, which is the cheaper place to catch it. Runnext buildlocally, not onlynext dev. - Cache amnesia. A deployed page that fails only in production often has a build-time
output: "export"mismatch; check that the route is not statically exported without a component.
When the failing file is minified or the stack is unreadable, paste the bundle fragment into the JSON formatter only to inspect embedded source maps, and use the diff tool to compare a working page against the broken one line by line. If the error arrives as an HTTP 500 response from a server you do not control, the status code reference tells you whether the gateway or the app is at fault.
Primary references: the Next.js page file convention defines the props and export contract, and the React element type validation notes explain the runtime check behind the equivalent React error.
Official references
primary documentationThe Next.js documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit Next.js work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Next.js guides
All Next.js guidesModule not found: Can't resolve a package or alias in Next.js
TypeScript and the bundler resolve imports separately. Align path aliases, workspace dependencies, exports conditions and filename case.
Next.js 16 DynamicServerError: cookies(), headers() and fetchCache
Request-time APIs make a route dynamic, and Next 16 replaced the segment configs with Suspense boundaries and use cache. What to delete and what to wrap.
Next.js cacheComponents: 'used uncached or runtime data' build error
Cache Components makes the build refuse to guess where the static shell ends. Stream it, cache it with use cache, or declare the route blocking.
next/font: Failed to fetch a Google font during the build
The font is fetched during the build, not at runtime. Vendor it with next/font/local or give CI and Docker a route out.
More in Next.js
All Next.js guidesThe guides filed next to this one in Next.js, in library order.