Share Posted January 30, 2020 To implement a smooth scroll I used TweenLite.set{.. within my code. Serving the project works fine without any errors. But as soon as I try to build the project using ng build, it throws following error: Quote Property 'set' does not exist on type 'typeof TweenLite'. How so? import { TweenLite } from 'gsap'; ... TweenLite.set(this.scroller.target, { rotation: 0.01, force3D: true }); "dependencies": { "@angular/animations": "~8.1.2", "@angular/common": "~8.1.2", "@angular/compiler": "~8.1.2", "@angular/core": "~8.1.2", "@angular/fire": "^5.2.3", "@angular/forms": "~8.1.2", "@angular/platform-browser": "~8.1.2", "@angular/platform-browser-dynamic": "~8.1.2", "@angular/router": "~8.1.2", "@types/gsap": "^1.20.2", "bootstrap": "^4.4.1", "firebase": "^7.6.1", "gsap": "^3.1.1", "rxjs": "~6.4.0", "tslib": "^1.9.0", "zone.js": "~0.9.1" } Link to comment Share on other sites More sharing options...
Share Posted January 30, 2020 Hey Tee, welcome to the GreenSock forums. If you import gsap instead of TweenLite and use that instead, does it still cause the error? Side note: You shouldn't load the @types definitions when using GSAP 3. GSAP 3 has its own type definitions bundled with it. 2 Link to comment Share on other sites More sharing options...
Share Posted January 30, 2020 For what it's worth, Angular has some known issues with their bundler, as referenced here: Basically it tree shakes incorrectly, flagging (and dumping) code that it thinks is irrelevant but isn't. Maybe reach out to the Angular folks? I'm pretty confident it's not a GSAP issue. 2 Link to comment Share on other sites More sharing options...
Author Share Posted January 30, 2020 49 minutes ago, ZachSaucier said: Hey Tee, welcome to the GreenSock forums. If you import gsap instead of TweenLite and use that instead, does it still cause the error? Side note: You shouldn't load the @types definitions when using GSAP 3. GSAP 3 has its own type definitions bundled with it. Thank you - using gsap.set(... did the trick! 1 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