Hi,
I am trying to get the Scroll Trigger to work on my gatsby website. I am a beginner at both Gatsby/React and GSAP so forgive my ignorance. I created a sandbox of how I did this in Gatsby. It works on development build like here on this sandbox but not when I try to go production build. I get this error "failed Building static HTML for pages". Does anyone know what I am doing wrong? Thanks! https://codesandbox.io/s/unruffled-cannon-v5wh4?file=/src/App.js
Gatsby's documention.
https://www.gatsbyjs.org/docs/debugging-html-builds/
So you either have to check.
if (typeof window !== "undefined") {
gsap.registerPlugin(...)
}
Or you have to put registerPlugin stuff in useEffect or componentDidMount.
Also, you might need to do this temp work around.