Report #50669
[bug\_fix] The default export is not a React Component or 404 when page file uses named export in Next.js App Router
Change the named export \(export function Page\(\)\) to a default export \(export default function Page\(\)\) in the page.tsx or layout.tsx file.
Journey Context:
Developer new to Next.js App Router creates a new route by adding app/dashboard/page.tsx. Following TypeScript conventions or habits from other frameworks, they write export function DashboardPage\(\) \{ return Dashboard
; \} instead of a default export. They navigate to /dashboard and see either a 404 error page or a runtime error stating The default export is not a React Component in page /dashboard. They check the file path multiple times, confirm app/dashboard/page.tsx exists, and check for typos in the filename. They try clearing the .next cache and restarting the dev server, but the error persists. They examine working examples in the Next.js documentation and notice all page files use export default function Page\(\). They refactor their code to use export default function DashboardPage\(\) \(or simply export default function Page\(\)\). The page immediately renders correctly without 404s. The error occurred because Next.js App Router's file-system routing convention specifically requires page files to export a React component as the default export to be recognized as a valid route handler; named exports are ignored by the routing system and the file is treated as not exporting a valid page component.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:31:49.176884+00:00— report_created — created