Closed neeramrutia closed 2 months ago
i have a similar problem
After reading the docs(https://www.gatsbyjs.com/docs/debugging-html-builds/), I added gatsby-node.js to the root of project(which I think ignores the Mantine modules) but no luck.
This is gatsby-node.js file :
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { if (stage === "build-html" || stage === "develop-html") { actions.setWebpackConfig({ module: { rules: [ { test: /bad-module/, use: loaders.null(), }, ], }, }) } }
For this to do anything you need to change /bad-module/
to a regexp that matches the module you want replaced
After reading the docs(https://www.gatsbyjs.com/docs/debugging-html-builds/), I added gatsby-node.js to the root of project(which I think ignores the Mantine modules) but no luck. This is gatsby-node.js file :
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { if (stage === "build-html" || stage === "develop-html") { actions.setWebpackConfig({ module: { rules: [ { test: /bad-module/, use: loaders.null(), }, ], }, }) } }
For this to do anything you need to change
/bad-module/
to a regexp that matches the module you want replaced
Thanks @nordenskiold
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { if (stage === "build-html" || stage === "develop-html") { actions.setWebpackConfig({ module: { rules: [ { test: /bad-module/, use: loaders.null(), }, ], }, }) } }
Adding the "bad module" solved this issue
Preliminary Checks
Description
I think there's some issue with Mantine & Gatsby when used together. command gatsby build shows this error : ` ERROR #95312 HTML.COMPILATION
"document" is not available during server-side rendering. Enable "DEV_SSR" to debug this during "gatsby develop".
See our docs page for more info on this error: https://gatsby.dev/debug-html
25 | colorSchemeManager = localStorageColorSchemeManager(), 26 | defaultColorScheme = "light",
WebpackError: ReferenceError: document is not defined`
After reading the docs(https://www.gatsbyjs.com/docs/debugging-html-builds/), I added gatsby-node.js to the root of project(which I think ignores the Mantine modules) but no luck.
This is gatsby-node.js file :
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { if (stage === "build-html" || stage === "develop-html") { actions.setWebpackConfig({ module: { rules: [ { test: /bad-module/, use: loaders.null(), }, ], }, }) } }
Reproduction Link
https://github.com/neeramrutia/gatsby-youtube-video-downloader
Steps to Reproduce
1.This issue is generated when mantine is used with gatsby
Expected Result
The gatsby build should work
Actual Result
gatsby build stills showing the same error : ERROR #95312 HTML.COMPILATION
"document" is not available during server-side rendering. Enable "DEV_SSR" to debug this during "gatsby develop".
See our docs page for more info on this error: https://gatsby.dev/debug-html
25 | colorSchemeManager = localStorageColorSchemeManager(), 26 | defaultColorScheme = "light",
WebpackError: ReferenceError: document is not defined
Environment
Config Flags
DEV_SSR:true