Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Missing component: <Html /> #14

Open
AaronNGray opened this issue Jul 6, 2021 · 1 comment
Open

Missing component: <Html /> #14

AaronNGray opened this issue Jul 6, 2021 · 1 comment

Comments

@AaronNGray
Copy link

Not sure if there are one or two issues here :-

event - compiled successfully
Material-UI: the createMuiTheme function was renamed to createTheme.

You should use `import { createTheme } from '@material-ui/core/styles'`
Warning: viewport meta tags should not be used in _document.js's <Head>. https://err.sh/next.js/no-document-viewport-meta
warn  - Your custom Document (pages/_document) did not render all the required subcomponent.
Missing component: <Html />
Read how to fix here: https://err.sh/next.js/missing-document-component
@yourleader
Copy link

I fix the problem add this

import React from 'react';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@material-ui/styles';

class MyDocument extends Document {
render() {
return (

    <body>
      <Html /> 
      <Head />
      <Main />
      <NextScript />
    </body>
  </html>
);

}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants