/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v16.3.0
errors/missing-document-component.mdx
40 строк
754 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: Missing Document Components --- ## Why This Error Occurred In your custom `pages/_document` an expected sub-component was not rendered. ## Possible Ways to Fix It Make sure to import and render all of the expected `Document` components: - `<Html />` - `<Head />` - `<Main />` - `<NextScript />` For example: ```tsx filename="pages/_document.tsx" import Document, { Html, Head, Main, NextScript } from 'next/document' export default class MyDocument extends Document { render() { return ( <Html> <Head /> <body> <Main /> <NextScript /> </body> </Html> ) } } ``` ## Useful Links - [Custom Document Docs](/docs/pages/building-your-application/routing/custom-document)