danboyle8637 Posted February 19, 2020 Share Posted February 19, 2020 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. Link to comment Share on other sites More sharing options...
GreenSock Posted February 19, 2020 Share Posted February 19, 2020 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. 2 Link to comment Share on other sites More sharing options...
danboyle8637 Posted February 19, 2020 Author Share Posted February 19, 2020 @GreenSock Yes that seemed to work. Strange since the base gsap works fine. I'll keep messing around but thank you for your help! 1 Link to comment Share on other sites More sharing options...
OSUblake Posted February 19, 2020 Share Posted February 19, 2020 19 minutes ago, danboyle8637 said: Strange since the base gsap works fine. Even though you didn't tell it to, your setup was actually loading from gsap/dist/gsap. Whenever you see something related to cjs (CommonJS), that means you should use the dist files. 4 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