Jump to content
Search Community

Install gsap in Vue+TS

Sagi Karni 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

Hi,

I'm trying to start using gsap in Vue with Typescript application.

I started to download gsap using npm (npm i gsap).

Then I wanted to import the library by :

import { TweenLite, Linear } from 'gsap'; 

Then i got the following error :

"cannot resolve definitions for module gsap"

I assumes I need to install typescript definition (right ?)

npm install @types/greensock

and added the following in the tsconfig.app.json

"types": ["greensock"]

Now I get the following error :

Duplicated Identifier 'Animation' (see atached screen)

 

Any advice ?

Thx

Sagi

 

 

 

 

gsap.png

Link to comment
Share on other sites

Hm, I'm not familiar with TypeScript and @types/greensock was *not* created by us, so I'm not quite sure what to advise. @OSUblake is the resident expert on this stuff, so perhaps he'll chime in (though he's pretty deep into a project right now and may not come up for air for a bit). That certainly sounds like a problme in the TypeScript definitions. 

Link to comment
Share on other sites

7 hours ago, GreenSock said:

That certainly sounds like a problme in the TypeScript definitions. 

 

Yeah, I never got around to making some official GSAP definitions. :(  Got sidetracked with other projects.

 

I can see from the image that it's conflicting with the interface for the native Web Animations API. What did you end up changing?

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
42 minutes ago, iDad5 said:

Would be interested in that answer too.

 

The whole types thing is screwy, but there are 2 different versions. 

 

@types/greensock is the old version which has the conflict.

https://www.npmjs.com/package/@types/greensock

 

@types/gsap is the newer, but still incomplete version. It shouldn't have that problem as the Animation class is now inside a "gsap" namespace.

https://www.npmjs.com/package/@types/gsap

 

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