Jump to content
Search Community

Inertia stopped working after update

wilsxt test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hey Greensock Forums, 

I wanted to add ScrollToPlugin to fix some anchor links on my site, and I noticed GSAP had updated from 3.6 to 3.7.1. 

So, I went ahead and updated all my CDN links in my functions.php file. I also downloaded a fresh version of InertiaPlugin and replaced my old copies on my server. 

Afterwards, everything was working except the IntertiaPlugin I had set up on my Dragable portfolio cards: https://www.bestfootforward.business/#portfolio
 

I can still drag it. I just don't have inertia any more even though it is set to true. 

 

It looks to me like the InertiaPlugin is being loaded in after GSAP with no issue, so I am a bit perplexed as to why my inertia is broken now. I tried doing a few searches and looking through the release notes with no luck. 

I know... CodePen... I have done it in the past, but I am hoping maybe there is an obvious issue you are familiar with first. If I have to I can copy and paste my JS over there though. Knowing my luck it will probably work fine in CodePen! 

Thanks a ton for the help.

Link to comment
Share on other sites

  • wilsxt changed the title to Inertia stopped working after update
  • Solution

I  believe it's because you never registered the plugin. By default, as a convenience the minified plugins will attempt to register themselves upon load, but that'll only work if GSAP is loaded at that point. It looks like you're loading InertiaPlugin BEFORE gsap, thus it can't register itself. I'd say the best solution is to simply register your plugin (best practice):

gsap.registerPlugin(InertiaPlugin);

Obviously you should register it before you try to use it. 

Link to comment
Share on other sites

Thanks a ton! I came down with a bad cold after posting, but I was able to try your fix today and it worked instantly. Saved me a ton of time poking around. 

I figured it was something like that, but I was a bit confused because I was going out of my way to try to get GSAP to load first. I guess because I had Inertia hosted locally it was always being loaded before CDN, even though I had set them to load in a different order. Now I know!

 

Thanks again I really appreciate the help. Enjoy your weekend!

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