ninmorfeo Posted January 17, 2020 Share Posted January 17, 2020 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 More sharing options...
ZachSaucier Posted January 17, 2020 Share Posted January 17, 2020 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 More sharing options...
ninmorfeo Posted January 17, 2020 Author Share Posted January 17, 2020 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 More sharing options...
ZachSaucier Posted January 17, 2020 Share Posted January 17, 2020 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 More sharing options...
ninmorfeo Posted January 17, 2020 Author Share Posted January 17, 2020 look herehttps://cartomanzia-tarocchi.com/tarocchi-gratis/ Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 17, 2020 Share Posted January 17, 2020 1 minute ago, ninmorfeo said: https://cartomanzia-tarocchi.com/tarocchi-gratis/ DrawSVGPlugin is not being loaded on that website currently. I don't see it in the Network tab of dev tools or in the markup in the HTML. Link to comment Share on other sites More sharing options...
ninmorfeo Posted January 17, 2020 Author Share Posted January 17, 2020 My JS file that calls DrawSVGPlugin is herehttps://cartomanzia-tarocchi.com/wp-content/plugins/giochi-carte/public/js/tarocchi-zingara-build.js Link to comment Share on other sites More sharing options...
ZachSaucier Posted January 17, 2020 Share Posted January 17, 2020 6 minutes ago, ninmorfeo said: js that call it is herehttps://cartomanzia-tarocchi.com/wp-content/plugins/giochi-carte/public/js/tarocchi-zingara-build.js 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 More sharing options...
ninmorfeo Posted January 17, 2020 Author Share Posted January 17, 2020 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 More sharing options...
ZachSaucier Posted January 17, 2020 Share Posted January 17, 2020 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. 2 Link to comment Share on other sites More sharing options...
ninmorfeo Posted January 17, 2020 Author Share Posted January 17, 2020 it s working now...thanks a lot 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now