vercel/next.js · error
Warning: <title> should not be used in _document.js's <Head>
Error message
Warning: <title> should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-title
What it means
In _document's Head render (dev only), children are scanned for a <title> element (react-helmet usage via data-react-helmet is exempted) and this warning is logged because page titles belong in the page or _app component, not _document's <Head>, where they cannot be per-page correct.
Source
Thrown at packages/next/src/pages/_document.tsx:668
if (child) {
otherHeadElements.push(
React.cloneElement(child, { 'data-next-head': '' })
)
}
}
})
head = cssPreloads.concat(otherHeadElements)
}
let children: React.ReactNode[] = React.Children.toArray(
this.props.children
).filter(Boolean)
// show a warning if Head contains <title> (only in development)
if (process.env.NODE_ENV !== 'production') {
children = React.Children.map(children, (child: any) => {
const isReactHelmet = child?.props?.['data-react-helmet']
if (!isReactHelmet) {
if (child?.type === 'title') {
console.warn(
"Warning: <title> should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-title"
)
} else if (
child?.type === 'meta' &&
child?.props?.name === 'viewport'
) {
console.warn(
"Warning: viewport meta tags should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-viewport-meta"
)
}
}
return child
// @types/react bug. Returned value from .map will not be `null` if you pass in `[null]`
})!
if (this.props.crossOrigin)
console.warn(
'Warning: `Head` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated'
)View on GitHub (pinned to 0eb3775416)
Solutions
- Use `next/head` in your page components for <title> instead of _document's <Head>.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/pages/_document.tsx:668 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/ee66e1863ec204e3.
Report an issue: GitHub.