ark icon indicating copy to clipboard operation
ark copied to clipboard

Missing component: <Html />

Open AaronNGray opened this issue 3 years ago • 1 comments

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

AaronNGray avatar Jul 06 '21 20:07 AaronNGray

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>
);

} }

yourleader avatar Oct 06 '21 16:10 yourleader