From f1fa834c1ed430afa46dc8a5e9c247c652ef1915 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Fri, 6 Dec 2024 10:52:06 +0100 Subject: [PATCH] docs: Add note on root layout for `output: export` (#1595) --- docs/src/pages/docs/routing/middleware.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/pages/docs/routing/middleware.mdx b/docs/src/pages/docs/routing/middleware.mdx index 539153fb0..70ce7c58b 100644 --- a/docs/src/pages/docs/routing/middleware.mdx +++ b/docs/src/pages/docs/routing/middleware.mdx @@ -431,6 +431,14 @@ export default function RootPage() { } ``` +Additionally, Next.js will ask for a root layout for `app/page.tsx`, even if it's just passing `children` through: + +```tsx filename="app/layout.tsx" +export default function RootLayout({children}) { + return children; +} +``` + ## Troubleshooting ### "The middleware doesn't run for a particular page." [#middleware-not-running]