Next.js: Missing Root Layout tags (html and body)
Next.js says Missing Root Layout tags? Your app/layout file returns children without the html and body tags. Wrap children in both and rebuild.
Reviewed October 25, 2026
What it means in plain English
Next.js's Missing Root Layout tags page says this error occurs when the <html> and/or <body> tags are not defined in your Root Layout. Next.js's layout docs say the app directory must include a root layout, the top-most layout in the root app directory, typically app/layout.js. The root layout must define the <html> and <body> tags.
Any layout without a layout.js above it is also a root layout. That happens with route groups such as app/(shop)/layout.js, or when app/layout.js is left out so that app/dashboard/layout.js becomes a root layout.
Likely causes
- The root layout returns
childrenon its own, with no<html>or<body>around it. - The
<html>tag is there but<body>is missing, or the other way round. - There is no
app/layoutfile, so a layout in a subfolder or route group became a root layout, and that layout has no<html>and<body>.
How to fix it, step by step
- Open the root layout file in the
appdirectory, for exampleapp/layout.tsx. - Make sure it returns both an
<html>and a<body>tag, withchildreninside<body>. This is the fix from Next.js's page:
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<html>
<body>
{children}
</body>
</html>
)
}
- If your app has more than one root layout, such as one per route group, check each of them. Each root layout must define
<html>and<body>. - Save, then run the dev server or
next buildagain.
How to check it worked
- The Missing Root Layout tags error no longer appears in the browser or the terminal.
next buildfinishes and the pages render.
Sources
Related fixes
More Next.js errors fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.