[gatsby-plugin-image] causes Uncaught ReferenceError: global
is not defined
#30094
-
Overview
I might be wrong here but, ReproductionYou can follow the instructions below or refer this example on CodeSandbox:
BehaviorActualThe development server throws no relevant warnings or errors in the terminal. The browser console logs the following error message:
The same can be seen in the following screenshot: ExpectedThis error should not exist and the site should run smoothly. Environment
gatsby info on the reproduction. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
ContextThis was originally reported here: wKovacs64/gatsby-plugin-use-dark-mode#73. |
Beta Was this translation helpful? Give feedback.
-
Hi! I moved this since the image plugin is only adding a webpack name: gatsby/packages/gatsby-plugin-image/src/gatsby-node.ts Lines 22 to 42 in a217661 It might be the case that webpack 5 also removed the polyfill for You might want to open an issue here: https://github.com/donavon/use-dark-mode |
Beta Was this translation helpful? Give feedback.
-
Same issue. Hope it gets resolved, but for now I just "polyfilled" it myself in the // gatsby-browser.js
window.global = window After that |
Beta Was this translation helpful? Give feedback.
-
Hey all, author of What I'm not clear on is whether those need updated to not use |
Beta Was this translation helpful? Give feedback.
-
Please try |
Beta Was this translation helpful? Give feedback.
Please try
gatsby-plugin-image@1.2.1
which should resolve it