import React from "react" ; import NextDocument , { Html , Head , Main , NextScript , DocumentContext , } from "next/document" ; import { ColorModeScript } from "@chakra-ui/react" ; import { config } from "theme/overrides" ; class Document extends NextDocument { static getInitialProps ( ctx ) { return NextDocument . getInitialProps ( ctx ) ; } render ( ) { return ( < Html lang = "en" > < Head > < /Head> < body > < ColorModeScript initialColorMode = { config . initialColorMode } /> < Main / > < NextScript /> < /body> < /Html>); } } export default Document ;