Jump to content
Search Community

InertiaPlugin is not defined though it is!

fewture test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi guys,

we are trying to use gsap.registerPlugin() to register the InertiaPlugin but it does not work unfortunately.
We enqueue the InertiaPlugin via our functions.php (WordPress) and it shows up as loaded in DevTools. 
However, the error exists. We even load it as type="module" as it throws another error if we don't.

We have set up a test website that demonstrates the issue:

https://atz.fewtureservicing.de/

We are very grateful for any help guys, thank you!!

Best regards,
Walid

Link to comment
Share on other sites

  • Solution

Thanks for being a Club GreenSock member, @fewture

 

It looks like you're loading InertiaPlugin as a module, but then expecting it to be defined as a global property on the window, but that's not now modules work. I think you'd be much better off just loading the minified ES5/UMD version of InertiaPlugin just like you're doing with all the other files. Just grab that from your download zip (in the "minified" folder). It should end in ".min.js". Load that via a normal <script src="..."> tag and you should be good-to-go. 

Link to comment
Share on other sites

Hi Jack,

thank you very much for your reply!
I tried that already, but unfortunately, it leads to another error which does not make any sense to me:

Cannot read properties of undefined (reading 'svg')

I do not get it... The lines where the error allegedly occurs have nothing to do with an svg, or am I missing something?
It seems as if there is a conflict with a theme which uses gsap as well (Semplice 6). But I am not calling anything related to that theme, and am working in a child-theme. 

Edit: It definetly is a conflict with the parent theme Semplice 6. I removed the error throwing script, and it resolved the issue. Will have to figure that out.
Thank you for pointing me in the right direction though!!

Best regards,
Walid

Link to comment
Share on other sites

I would definitely recommend updating your version of GSAP - that may resolve the issue by itself because we added some code to work around some edge cases that might be one you're dealing with. It looks like you're using 3.11.0 but we're at 3.12.2 at this point. 

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