Jump to content
Search Community

undefined (reading 'getScrollFunc')

TechExtensor test
Moderator Tag

Recommended Posts

core.mjs:6461 ERROR TypeError: Cannot read properties of undefined (reading 'getScrollFunc')
    at new ScrollSmoother (ScrollSmoother.js:118:1)
    at push.2070.ScrollSmoother.create (ScrollSmoother.js:762:1)
    at AnimationsService.animationsText (animations.service.ts:21:5)
    at UpcomingEventsComponent.ngOnInit (upcoming-events.component.ts:17:27)
    at callHook (core.mjs:2518:1)
    at callHooks (core.mjs:2487:1)
    at executeInitAndCheckHooks (core.mjs:2438:1)
    at refreshView (core.mjs:9474:1)
    at refreshEmbeddedViews (core.mjs:10584:1)
    at refreshView (core.mjs:9483:1)

Screenshot_3.png

See the Pen KKXZOyZ by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Yeah, that error definitely means that ScrollTrigger doesn't exist when you're calling ScrollSmoother.create(). Can you try to console.log(ScrollTrigger) right before your ScrollSmoother.create() and see what happens? Sorry, it's just very difficult to troubleshoot blind. If we had a minimal demo that shows the issue, we'd be able to offer much better advice. It sure sounds like your build system is somehow breaking things, maybe by over-aggressive tree shaking or something like that(?) 

 

Also, it probably doesn't matter much but I'd definitely put ScrollTrigger first in your gsap.registerPlugin(ScrollTrigger, ScrollSmoother) because ScrollSmoother is dependent on ScrollTrigger, thus ScrollTrigger is best to register first. 

  • Like 1
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...