Jump to content
Search Community

Uncaught TypeError: Cannot read property 'push' of un

crammy90 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi there,

 

I have the below website (you will need to login using the details below) but the console is showing errors such as the below, which is affecting the sites ability to scroll on chrome. It also changes the cursor to the non expected state (i.e. hover on a div shows a hand etc).

 

Uncaught TypeError: Cannot read property 'length' of undefined TweenMax.min.js?ver=1407199624:14

Uncaught TypeError: Cannot read property 'push' of undefined

 

 

 

I am not sure how to fix the console errors above, so am just looking for some advice. Ive tried googling to no avail.

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

I'm guessing it may be because you are loading 2 versions of TweenMax. It appears you are loading the latest version from cdnjs (1.13.1) which is fine but a plugin called layerSlider is loading one from http://cappsule.me/wp-content/plugins/LayerSlider/static/js/greensock.js?ver=1.11.2&versions=1406620131

 

I would start by disabling that WP plugin.

  • Like 1
Link to comment
Share on other sites

Yep, I echo Carl's advice, and it also looks like you're loading CSSPlugin and EasePack which are both already inside TweenMax anyway. So just load TweenMax, and you should be done (as far as GreenSock tools). That wouldn't cause the errors you mentioned, though. Technically things should still work fine if you load those extras, but it's wasteful. You definitely shouldn't be loading two versions of TweenMax/TweenLite.

 

It's tricky to troubleshoot a whole app like that which has tons of scripts loaded and...well...a lot of moving parts. My advice would be to try to strip things down to the bare essentials, get it working and then add things until it breaks. That'll help you identify where the trouble is. 

Link to comment
Share on other sites

Also, I am not sure if I can ask this here,

 

but it is all working which is great, but this is my first project using greensock and I just wanted to ask whether it matters which order I stack the different things.

 

i.e.

.addTo(controller)

.triggerHook("onLeave")
.setTween(shakecapp);
 
 

.setTween(shakecapp)

.triggerHook("onLeave")
.addTo(controller);
Link to comment
Share on other sites

  • 3 months later...

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