vercel/next.js · error
Your page ${bold(`app/${normalizedPagePath}`)} did not have
Error message
Your page ${bold(`app/${normalizedPagePath}`)} did not have a root layout. We created ${bold(`app${rootLayoutPath.replace(appDir, '')}`)} for you. What it means
verifyRootLayout detects an app-router page rendered without a root layout, writes a minimal layout.(tsx|js) into the app directory automatically, and warns that it did so — a dev-time convenience so rendering can proceed rather than failing on the missing layout.
Source
Thrown at packages/next/src/lib/verify-root-layout.ts:129
availableDir = ''
}
if (typeof availableDir === 'string') {
const tsConfigFileName = tsconfigPath || 'tsconfig.json'
const resolvedTsConfigPath = path.join(dir, tsConfigFileName)
const hasTsConfig = await fs.access(resolvedTsConfigPath).then(
() => true,
() => false
)
rootLayoutPath = path.join(
appDir,
availableDir,
`layout.${hasTsConfig ? 'tsx' : 'js'}`
)
await fs.writeFile(rootLayoutPath, getRootLayout(hasTsConfig))
Log.warn(
`Your page ${bold(
`app/${normalizedPagePath}`
)} did not have a root layout. We created ${bold(
`app${rootLayoutPath.replace(appDir, '')}`
)} for you.`
)
// Created root layout
return [true, rootLayoutPath]
}
} catch (e) {
console.error(e)
}
// Didn't create root layout
return [false, rootLayoutPath]
}
View on GitHub (pinned to 0eb3775416)
Solutions
- Keep the generated root layout file, or create app/layout.tsx yourself exporting a RootLayout component.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/next/src/lib/verify-root-layout.ts:129 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/2c5e7a930cabacb4.
Report an issue: GitHub.