missing-root-layout-tags.mdx


title: Missing Root Layout tags

Why This Error Occurred

You forgot to define the <html> and/or <body> tags in your Root Layout.

Possible Ways to Fix It

To fix this error, make sure that both <html> and <body> are present in your Root Layout.


export default function Layout({ children }: { children: React.ReactNode }) {
-  return children
+  return (
+    <html>
+      <body>
+        {children}
+      </body>
+    </html>
+  )
}

Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.

errors/missing-root-layout-tags.mdx · vercel/next.js | Docs MD