{"record":{"id":"ee66e1863ec204e3","repo":"vercel/next.js","slug":"warning-title-should-not-be-used-in-document-j","errorCode":null,"errorMessage":"Warning: <title> should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-title","messagePattern":"Warning: <title> should not be used in _document\\.js's <Head>\\. https://nextjs\\.org/docs/messages/no-document-title","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/pages/_document.tsx","lineNumber":668,"sourceCode":"          if (child) {\n            otherHeadElements.push(\n              React.cloneElement(child, { 'data-next-head': '' })\n            )\n          }\n        }\n      })\n      head = cssPreloads.concat(otherHeadElements)\n    }\n    let children: React.ReactNode[] = React.Children.toArray(\n      this.props.children\n    ).filter(Boolean)\n    // show a warning if Head contains <title> (only in development)\n    if (process.env.NODE_ENV !== 'production') {\n      children = React.Children.map(children, (child: any) => {\n        const isReactHelmet = child?.props?.['data-react-helmet']\n        if (!isReactHelmet) {\n          if (child?.type === 'title') {\n            console.warn(\n              \"Warning: <title> should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-title\"\n            )\n          } else if (\n            child?.type === 'meta' &&\n            child?.props?.name === 'viewport'\n          ) {\n            console.warn(\n              \"Warning: viewport meta tags should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-viewport-meta\"\n            )\n          }\n        }\n        return child\n        // @types/react bug. Returned value from .map will not be `null` if you pass in `[null]`\n      })!\n      if (this.props.crossOrigin)\n        console.warn(\n          'Warning: `Head` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated'\n        )","sourceCodeStart":650,"sourceCodeEnd":686,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/pages/_document.tsx#L650-L686","documentation":"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.","triggerScenarios":"Thrown at packages/next/src/pages/_document.tsx:668 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use `next/head` in your page components for <title> instead of _document's <Head>."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}