Jump to content
Search Community

ScrollSmother JS Error

mark zhang test
Moderator Tag

Recommended Posts

Hi,

 

I would like to know what is the min/max compatibility with GSAP and ScrollSmother? I tried with GSAP 3.12 and the latest .min file for ScrollSmother(3.12.2) it shown as error. Unfortunately the error is not appearing on codepen demo. So, I can't give a demo here.

 

image.thumb.png.112183f0a4ccc8e985e336ca73531cde.png

Link to comment
Share on other sites

Thanks for letting us know. By the way, I suspect you might be calling gsap.registerPlugin(ScrollSmoother) when there's no window or document defined (like in an SSR environment) - is that right? Are you using Next/React or something? It's typically best to register the plugin when the window/document exist. 

Link to comment
Share on other sites

Oh yes, it looks like you're doing it right then. I'm glad the latest version resolves things for you. And it totally makes sense because ScrollSmoother was introduced long after ScrollTrigger version 3.4, and it's built on top of ScrollTrigger so if you had a really old version of ScrollTrigger like that then it isn't surprising that it was problematic. 

 

Thanks for being a Club GSAP member! 💚

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...