From 2b382dea59524fa671710d7e4ec56fa51df6d955 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Sat, 12 Sep 2020 13:39:16 -0400 Subject: [PATCH] Improve Document Component Error (#17047) --- errors/missing-document-component.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/errors/missing-document-component.md b/errors/missing-document-component.md index 89fcdb1081eb0b..74ab4d738a159c 100644 --- a/errors/missing-document-component.md +++ b/errors/missing-document-component.md @@ -6,7 +6,32 @@ 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. +Make sure to import and render all of the expected `Document` components: + +- `` +- `` +- `
` +- `` + +For example: + +```tsx +import Document, { Html, Head, Main, NextScript } from 'next/document' + +export default class MyDocument extends Document { + render() { + return ( + + + +
+ + + + ) + } +} +``` ### Useful Links