Jump to content
Search Community

Issue with ScrollTrigger with {once: true;} after upgrading GSAP

benrbnt test
Moderator Tag

Recommended Posts

Hello,

 

I just upgraded to 3.12.1 from 3.11.5, and ScrollTrigger crash when I go to a page with a scroll restauration, containing a ScrollTrigger with {once: true}.

I can't manage to reproduce it in a Codepen, I still did one: ...

 

I feel like ScrollTrigger is trying to refresh an already killed (due to the once: true) one. 

 

I have errors like: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'end')

 

    const tl = gsap.timeline({
        scrollTrigger: {
            start: 'top 90%',
            end: 'bottom 10%',
            trigger: '.element',
            once: true,
            toggleActions: 'play none play none',
        },
    });

 


 

See the Pen ZEmBBVq by benjaminrobinet (@benjaminrobinet) on CodePen

Link to comment
Share on other sites

A few questions: 

  1. If you paste the SAME code as the CodePen demo into your "real" project, are you saying that generates an error (or crash)? 
  2. Is there any way you can provide some kind of demo that reproduces the issue? It's just super hard for us to troubleshoot blind. Once we can reproduce it, I'm confident we'll be able to figure it out. 
  3. Do you maybe have components in your project that are using an old version and some with the new version? Have you tried clearing all caches, including for your build process and make sure everything is using a consistent version? 
  4. Are you using any framework like React? If so, are you using gsap.context()?
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...