Jump to content
Search Community

DrawSVG Plugin

Five&Done test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello, I am probably missing something simple- but I am trying to get DrawSVG working and I am getting this error straight away:

Uncaught SyntaxError: Unexpected token { 

 

which is this line: 

 

import { _gsScope } from "gsap/TweenLite.js"; 

 

Does this plugin work using the Local downloaded/purchased DrawSVGPlugin.js file while using TweenMax from the CDN?

 

Thanks!

Link to comment
Share on other sites

Hi @Five&Done :)

 

Welcome to the forum and thanks for joining Club GreenSock.

 

Sorry to hear that you're experiencing problems. The drawSVG plugin should work just fine locally while using TweenMax from the CDN. Are you loading TweenMax first? If you could paste a copy of your code or a demo that shows the issue, we'll see if we can spot the problem.

 

Happy tweening and welcome aboard.

:)

 

  • Like 2
Link to comment
Share on other sites

It kinda sounds like you're trying to use the ES module directly in a browser that doesn't support ES modules(?) Maybe just try using the standard (ES5) files from the "minified" folder in your downloads. That won't have that "import" statement at all. It's plain vanilla ES5 stuff. 

  • Like 3
Link to comment
Share on other sites

HI Craig- I figured out the problem. I had only copied over the plugin file to my project js folder- once I moved the entire "uncompressed" folder to js/gsap/ everything seems to now work even though I am only referencing the CDN TweenMax and the local plugin in my HTML file. Thanks!

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