Jump to content
Search Community

DrawSVGPlugin issue

glassbean test
Moderator Tag

Recommended Posts

Hello there,

 

After playing the DrawSVGPlugin today I've decided to use it in commercial project which is great. I was using DrawSVGPlugin3.min.js locally and created some animations. Ive now got a business license and have unzipped the plugin library. I notice there is no CDN for the plugins so I'm linking to DrawSVGPlugin.js locally in my files (Im assuming the syntax is the same either .js files?. Now the plugin no longer works. How do i get this working. Apologies if this is a stupid question.

Thanks,
G

Link to comment
Share on other sites

  • glassbean changed the title to DrawSVGPlugin issue

Thanks Zach,

I'll take  a look at the link you sent, in the meantime this is the console error I get:

SyntaxError: export declarations may only appear at top level of a module

I'm only using very simple syntax in my file:


  .from("#screen", { drawSVG: 0},'-=.1')
   .from("#buttons path", { drawSVG: 0, stagger: .1 })

 

As I say, it works fine with DrawSVGPlugin3.min.js in the local directory, but not with DrawSVGPlugin.js

I'm using
gsap_3.1.0_min.js, perhaps DrawSVGPlugin.js is not compatible with GSAP3?

Thanks,
G
 

Link to comment
Share on other sites

11 minutes ago, glassbean said:

SyntaxError: export declarations may only appear at top level of a module

That means that you're trying to use the modules version of the GSAP plugins when you should be using the regular minified version. (Or you are trying to export something from your script when it's not a module but I think that's less likely).

 

I recommend download the latest version of GSAP (3.6.0 currently) from the GreenSock website and using the minified version of the plugins included in the ZIP. It should be DrawSVGPlugin.min.js.

  • Like 1
Link to comment
Share on other sites

thanks for this, actually I realized this just at the very same time after reading the instillation guide. Swapped to DrawSVGPlugin.min.js

 

and now it al works fine... arh.. sorry for wasting your time but I learned something, I assumed the minified and module versions would both work...

Thanks again,
B

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