Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
ninmorfeo

DrawSVGPlugin is not defined

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)

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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. 

Share this post


Link to post
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. 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

No. You likely don't need to register the plugins at all since you're just using plain HTML files. You need to load all plugins in their own script tags after GSAP is loaded but before your build file. 

  • Like 2

Share this post


Link to post
Share on other sites

it s working now...thanks a lot :)

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×