Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
9adf3bb6
Unverified
Commit
9adf3bb6
authored
Sep 12, 2020
by
Joe Haddad
Committed by
GitHub
Sep 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Document Component Error (#17047)
parent
d113c640
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
missing-document-component.md
errors/missing-document-component.md
+26
-1
No files found.
errors/missing-document-component.md
View file @
9adf3bb6
...
@@ -6,7 +6,32 @@ In your custom `pages/_document` an expected sub-component was not rendered.
...
@@ -6,7 +6,32 @@ In your custom `pages/_document` an expected sub-component was not rendered.
#### Possible Ways to Fix It
#### Possible Ways to Fix It
Make sure to import and render all of the expected
`Document`
components.
Make sure to import and render all of the expected
`Document`
components:
-
`<Html />`
-
`<Head />`
-
`<Main />`
-
`<NextScript />`
For example:
```
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
### Useful Links
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment