Jump to content
Search Community

Bonus Plugins not loading

danboyle8637 test
Moderator Tag

Recommended Posts

I just renewed today so I'm not sure this has something to do with it... but my bonus plugins are not loading.

 

I'm using NextJS (newest version), React. 

I am using Typescript as well and I noticed the DrawSVGPlugin was a JS file.

 

import { gsap } from 'gsap'
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin'

const MyComponent = () => {

  // I tried this outside the component as well as...
  // And in a useEffect that runs when the component mounts.
  gsap.registerPlugin(DrawSVGPlugin)
  
  useEffect(() => {
  	tl.to(element, {
    	drawSVG: '0% 100%'
    })
  }, [])

}

I am getting the following error It's attached. 

1247975518_ScreenShot2020-02-19at1_40_08PM.thumb.png.296c068b34c6a1757610f1128e8ac125.png

Link to comment
Share on other sites

Hm, that message typically means you're using ES Modules in an older environment that doesn't support them. Maybe try importing the UMD versions of the GSAP files which are pretty universally compatible - those are tucked in the /dist/ directory:

 

import { gsap } from 'gsap/dist/gsap'
import { DrawSVGPlugin } from 'gsap/dist/DrawSVGPlugin'

Does that work better for you? 

 

If not, it'd be super helpful if you could post a reduced test case that reproduces the issue. We'd love to help. 

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