Jump to content
Search Community

Recommended Posts

Posted

Showing Below Warning and error

Uncaught ReferenceError: ScrollTrigger is not defined

ScrollTrigger.min.js:10 Please gsap.registerPlugin(ScrollTrigger)

ScrollTrigger @ ScrollTrigger.min.js:10
G.create @ ScrollTrigger.min.js:10
(anonymous) @ mainPage.html:20
ScrollTrigger.min.js:10 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')
    at N (ScrollTrigger.min.js:10:415)
    at ScrollTrigger.init (ScrollTrigger.min.js:10:8528)
    at new ScrollTrigger (ScrollTrigger.min.js:10:18901)
    at G.create (ScrollTrigger.min.js:10:19167)
    at mainPage.html:20:15

See the Pen RwBryXR by rohit165 (@rohit165) on CodePen.

Posted

Heya!

 

There's no warning in that pen for me

 

That error means that you need to register your plugin though - e.g.
 

gsap.registerPlugin(ScrollTrigger)

 

Posted

I have already mentioned the 

Quote

gsap.registerPlugin(ScrollTrigger)

 

Posted

Hello , 

 If you are getting the error in the console, 

Make sure to add you js file below the cdn links.

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/ScrollTrigger.min.js"></script>
<script src="/js/app.js"></script>

Something like this
 

Posted

@RohitSharma can you provide a minimal demo that clearly shows the problem? That CodePen works find and has no such errors. The only reason you'd be seeing that error message is if you forgot to call gsap.registerPlugin(ScrollTrigger) BEFORE you try using ScrollTrigger. 

 

If you're still having trouble, we'd be happy to take a look at a minimal demo that clearly shows the problem. We certainly want to help. 

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...