TOB Posted July 1, 2020 Share Posted July 1, 2020 ive added both gsap (npm install --save gsap) and @types/greensock (npm install --save-dev @types/greensock) to my prototype app I am using to learn more about greensock. npm install completes successfully, however when building the app, I get a "Duplicate identifier 'TimelineMax'" error. I've confirmed that there are multiple definitions of this and other gsap classes in both these lib's (found in gsap-core.d.ts for gsap and index.d.ts for @types/greensock). I did find the install instructions (here: https://greensock.com/docs/v3/Installation) which references 'typescript errors" re: locations of types being defined - - - but that didn't work. Was wondering if there is something else I am missing? Thx in advance for any insights Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 1, 2020 Share Posted July 1, 2020 Hey TOB and welcome to the GreenSock forums! Uninstall the @types declarations - you don't need them and they are invalid with GSAP 3 (not to mention not complete for GSAP 2). The official Typescript declarations come with GSAP when you install it. By the way, there's no reason to use the Max/Lite stuff in GSAP 3. Just use the GSAP object. For more information check out the migration guide: Link to comment Share on other sites More sharing options...
OSUblake Posted July 1, 2020 Share Posted July 1, 2020 37 minutes ago, ZachSaucier said: @types declarations - you don't need them and they are invalid with GSAP 3 I think you might be able to get those removed so people will stop trying to install them. https://github.com/DefinitelyTyped/DefinitelyTyped#removing-a-package 1 Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 1, 2020 Share Posted July 1, 2020 30 minutes ago, OSUblake said: I think you might be able to get those removed so people will stop trying to install them. Following the steps, it says not-needed.js is not found. Does it work for you? Link to comment Share on other sites More sharing options...
OSUblake Posted July 1, 2020 Share Posted July 1, 2020 I didn't try. You ran that command with the repo? Link to comment Share on other sites More sharing options...
OSUblake Posted July 1, 2020 Share Posted July 1, 2020 1 minute ago, OSUblake said: I didn't try. ... because I think you have to make a PR, and you or Jack should be the owner. Link to comment Share on other sites More sharing options...
TOB Posted July 2, 2020 Author Share Posted July 2, 2020 Thanks - that did the trick. I had to add an empty "files" : [ ] to my tsconfig as well (to get around an error "./gsap-utils.d.ts (209,10): A rest parameter must be of an array type."... I suspect that perhaps my typescript version is not recent enough [~2.5.3 atm]). This empty config entry is throwing my lint'r off its game 😕 BUT app does compile and I can run the animations easily. Thanks again for the assist - great forum support (which makes all the difference); and gsap is fall-down easy to use. Link to comment Share on other sites More sharing options...
OSUblake Posted July 2, 2020 Share Posted July 2, 2020 13 minutes ago, TOB said: to get around an error "./gsap-utils.d.ts (209,10): A rest parameter must be of an array type." Is that pointing to this the gsap-utils.d.ts file? It's seem weird that in would complain about that when there are rest params before it. Link to comment Share on other sites More sharing options...
TOB Posted July 2, 2020 Author Share Posted July 2, 2020 (edited) Yes - thats the one, with the 'G' template item. edit: That 209 was at the top of the stack, but if I scroll down more in the build error list I do see the others. Edited July 2, 2020 by TOB added details re: build error stack Link to comment Share on other sites More sharing options...
OSUblake Posted July 2, 2020 Share Posted July 2, 2020 Hm... it looks like unknown was added in TypeScript 3.0. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#new-unknown-top-type Curious, if you find and replace all the unknown with any, does it compile? 1 Link to comment Share on other sites More sharing options...
TOB Posted July 2, 2020 Author Share Posted July 2, 2020 No joy did the pipe overloads (between lines 183 and 245) and did the unitize method on line 400. Same compile errors. Link to comment Share on other sites More sharing options...
OSUblake Posted July 2, 2020 Share Posted July 2, 2020 I'm not sure if we can fix it without rewriting a bunch of stuff. It looks like this might be an old problem. https://github.com/microsoft/TypeScript/issues/15972 Is there any reason you can't upgrade to a new version? 1 Link to comment Share on other sites More sharing options...
TOB Posted July 2, 2020 Author Share Posted July 2, 2020 I'm looking into that option now. I have a specific version of typescript I use at work as part of a larger dev team; but will see if I can use a later version of typescript (e.g. something like npm install --save-dev typescript@latest) for this prototype. Is there a recommended version of typescript in your opinion? or is latest best? Link to comment Share on other sites More sharing options...
OSUblake Posted July 2, 2020 Share Posted July 2, 2020 7 hours ago, TOB said: Is there a recommended version of typescript in your opinion? or is latest best? I would use latest, but they should work for any 3.* version. 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