import Document , { DocumentContext , DocumentInitialProps } from "next/document" ; import { resetId } from "../../lib" ; class MyDocument extends Document { static async getInitialProps ( ctx ) { resetId ( ) ; const initialProps = await Document . getInitialProps ( ctx ) ; return { ... initialProps } ; } } export default MyDocument ;