Jump to content
Search Community

DrawSVGPlugin is not defined

ninmorfeo test
Moderator Tag

Recommended Posts

hi
i have this code and in folder i public last version gsap bonus file but plugin DrawSVGPlugin.min wasn t load...
what s wrong ? corrupted file ?
 

$(document).ready(function () {
    gsap.registerPlugin(InertiaPlugin, Draggable, EasePack, MotionPathPlugin, MotionPathHelper, DrawSVGPlugin);
});

 

tarocchi-zingara-build.js:12 Uncaught ReferenceError: DrawSVGPlugin is not defined
    at HTMLDocument.<anonymous> (tarocchi-zingara-build.js:12)
    at i (jquery.js?ver=1.12.4-wp:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
    at Function.ready (jquery.js?ver=1.12.4-wp:2)
    at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)

Link to comment
Share on other sites

Hey ninmorfeo,

 

Without seeing the project ourselves it's hard to tell. Could you host it online somewhere per chance?  

 

My guess is that you're using a wrong version of DrawSVGPlugin. Maybe try using the UMD version and see if that works? Keep in mind it's uncompressed so you probably don't want to use it in production.

Link to comment
Share on other sites

 

it is the only file that gives me problems. I'm working in local machine .... do you have any other repository where I can download the file so I can understand if I have a corrupt version? I emphasize that the file comes from the official zip that I downloaded under the reserved area

Link to comment
Share on other sites

32 minutes ago, ninmorfeo said:

do you have any other repository where I can download the file so I can understand if I have a corrupt version?

Nope. But I have tested the version I downloaded from the site and it doesn't have issue. Can you please create host your page online for us to take a look at what is going wrong? It's hard for us to help blindly. 

Link to comment
Share on other sites

6 minutes ago, ninmorfeo said:

Saying .registerPlugin() is not calling it. There is no file lookup or loading that is done. registerPlugin just looks for the listed plugins and registers them globally if they're found. You don't even need to do it if you're loading things via script tags like this.

 

You need to load DrawSVGPlugin before your build file is ran:

<script src="https://cartomanzia-tarocchi.com/wp-content/plugins/giochi-carte/public/js/DrawSVGPlugin.min.js"></script>
<script src="https://cartomanzia-tarocchi.com/wp-content/plugins/giochi-carte/public/js/tarocchi-zingara-build.js"></script>

 

I suppose we should make that more clear in the registerPlugin docs, but we didn't realize this issue would come up. 

Link to comment
Share on other sites

so I have to enter gsap.registerPlugin (InertiaPlugin, Draggable, EasePack, MotionPathPlugin, MotionPathHelper, DrawSVGPlugin); in the window load? before document ready?
or load it register it as js extra in wp with l enqueque

ok i undestand..i ll try

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