This works fine when running 'gatsby develop', but throws the following error when running 'gatsby build':
"window" is not available during server side rendering.
See our docs page for more info on this error: https://gatsby.dev/debug-html
21 | // to operate correctly into non-standard environments
22 | // @see https://github.com/webpack-contrib/style-loader/issues/177
> 23 | return window && document && document.all && !window.atob;
| ^
24 | });
25 |
26 | var getTarget = function (target, parent) {
WebpackError: ReferenceError: window is not defined
I tried to exchange style loader with 'isomorphic'style-loader' which throws NO error when runnning 'gatsby build' but then the style is not injected into the dom at all when running 'gatsby develop'.
I'm using ant design in a gatsby project and I extend the webpack config to customize the ant design themes using the following code snippets:
This works fine when running 'gatsby develop', but throws the following error when running 'gatsby build':
I tried to exchange style loader with 'isomorphic'style-loader' which throws NO error when runnning 'gatsby build' but then the style is not injected into the dom at all when running 'gatsby develop'.