Jump to content
Search Community

Problems with PhpStorm and SvelteKit

aplons test
Moderator Tag

Recommended Posts

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);

image.png.5ec19d54ccb5ff6005c02f90443e3523.png

 

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

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

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