ramako Posted March 6 Share Posted March 6 Hello, using typescript 5.2.2 webpack 5.88, gsap latest after recently trying the free version of gsap, we decided to move to the business one. I have set up the .npmrc and added @gsap/business to my package.json, and then installed it with npm i. The previous imports that worked with the free version, have stopped working with the business one. import { gsap } from 'gsap'; this now throws an error that it cannot find the module, however it appears to be typed correctly. When trying to run it with webpack, this causes a module can't be found error, it seems to be looking for node_modules/gsap but gsap business gets installed in @gsap. Importing like this: import { gsap } from '@gsap/business/gsap-core'; import { PixiPlugin } from '@gsap/business/PixiPlugin'; works with webpack, but I lose the types and eslint still complains. Going into gsap.core.d.ts shows a few errors: Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted March 6 Solution Share Posted March 6 Hi @ramako and welcome to the GSAP Forums! Thanks for being a GSAP Club member and supporting GSAP! 💚 There is no need to change the imports, the alias is just for the NPM installation that's all. If you check the node_modules folder in your project, you'll see that the folder's name is still gsap. Just import your files as shown in our installation guide: import { gsap } from "gsap"; import { PixiPlugin } from "gsap/PixiPlugin"; gsap.registerPlugin(PixiPlugin); Hopefully this clear things up. Happy Tweening! Link to comment Share on other sites More sharing options...
ramako Posted March 6 Author Share Posted March 6 Hello @Rodrigo, thanks for answering. I believe I have just realized my mistake, I manually added "@gsap/business" : "3.12.2" to package.json dependencies and ran npm i, when really I should have just followed the installation notes and ran: npm install gsap@npm:@gsap/member thanks for your answer! 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