aplons Posted May 22 Share Posted May 22 Hey there, I'm working on a project right now and wanted to use GSAP for that, but I have a problem setting it up with SvelteKit and Typescript. I tried importing the module with the Text Plugin and everything works fine in the Browser but PhpStorm displays an error when I try registering the plugin. I registered GSAP and the TextPlugin like in the following example import gsap from 'gsap/dist/gsap'; import { TextPlugin } from 'gsap/dist/TextPlugin'; gsap.registerPlugin(TextPlugin); But just like you see on the image I get an error 'Unresolved function or method registerPlugin()' The same error is happening when I try to use gsap.fromTo but not when I use gsap.to etc. Its pretty weird, cause just like I said everything works fine in the browser 😕 Thank you very much! Link to comment Share on other sites More sharing options...
Rodrigo Posted May 22 Share Posted May 22 Hi @aplons and welcome to the GreenSock forums! Sorry about the issues, but honestly I don't have any experience with PHP Storm and not a lot with Typescript. There is a set of files that define the types though: https://github.com/greensock/GSAP/tree/master/types That should be added when you install GSAP in your project. Also there are type definitions for the fromTo() method: https://github.com/greensock/GSAP/blob/master/types/gsap-core.d.ts#L322 And the registerPlugn method: https://github.com/greensock/GSAP/blob/master/types/gsap-core.d.ts#L568 In VSCode I never had any issues with types so I don't know what to tell you. Sorry I can't be of more assistance. Happy Tweening! Link to comment Share on other sites More sharing options...
GreenSock Posted May 23 Share Posted May 23 Yeah, I'm not sure what to say but it seems like an issue on your end (probably with TypeScript?) - I use PhpStorm too and I don't see any of those errors. 🤷♂️ 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