Encountering an issue with web packs and nextjs.
import NextDocument, { Html, Head, Main, NextScript } from 'next/document'
import theme from '../libs/theme.js'
export default class Document extends NextDocument {
render() {
return (
<Html lang="en">
<Head />
<ColorModeScript initialColorMode={ theme.config.initialColorMode } />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
Error message: ReferenceError: Cannot access 'WEBPACK_DEFAULT_EXPORT' before initialization.
9 | <Head />
> 10 | <ColorModeScript initialColorMode={ theme.config.initialColorMode } />
| ^
11 | <body>
12 | <Main />
13 | <NextScript />
In need of a solution for this problem. Any help would be greatly appreciated!