birkir / gatsby-source-prismic-graphql

Gatsby source plugin for Prismic GraphQL
MIT License
137 stars 75 forks source link

`window` undefined in build (not during build, in deployed site/site build) #122

Open BarneyLoosemore opened 4 years ago

BarneyLoosemore commented 4 years ago

Hi, I have a Gatsby site that makes use of eventListener's & was confused to find them not working in my deployed site, despite being perfectly functional locally. I have safety checks (typeof window !== 'undefined') so the site builds fine - window just appears to be undefined in the site build.

I've used gatsby-source-prismic and encountered none of the same issues with window, and I see that gatsby-source-prismic-graphql touches the window global on a number of occasions - just wondering if anyone has any input on this?

aodysseos commented 4 years ago

I am having the same issue and additionally all my onClick events won't work after gatsby build and serve the site. Removing gatsby-source-prismic-graphql makes the events work again. I had no issues while using gatsby-source-prismic or when I am working locally.

l5s commented 4 years ago

Are you using a framework?