JohnJesse Posted March 24, 2020 Share Posted March 24, 2020 I don't think the typings are working correctly here. I was reading through some of the docs and thought that I had the option of importing from `gsap` of `gsap/all` etc But - when I import from one of the sub files e.g. `gsap/all` typescript fails to find the types for the module This is resolved if I import from `gsap` instead. This seems like a bug - as I lose the typings for importing from `gsap/...` See the Pen by s (@s) on CodePen Link to comment Share on other sites More sharing options...
OSUblake Posted March 24, 2020 Share Posted March 24, 2020 1 minute ago, JohnJesse said: This is resolved if I import from `gsap` instead. That's a problem with how typescript looks for definitions. When you use "gsap/all", it looks for a package named gsap/all, which of course doesn't exist. So you either have to import from "gsap" in at least 1 file, or tell the compiler where the definitions are in a tsconfig. See the FAQ. https://greensock.com/docs/v3/Installation { "compilerOptions": { ... }, "files": [ "node_modules/gsap/types/index.d.ts" ] } 2 Link to comment Share on other sites More sharing options...
JohnJesse Posted March 24, 2020 Author Share Posted March 24, 2020 Ah ok, I need to explicitly tell typescript where to find the types, fair enough, Thanks 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