Jump to content
Search Community

GSAP import failing after moving from the free version to the business one

ramako test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

 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.image.thumb.png.75ded2ef55dc4f1b072692555dffa8ff.png

 

Going into gsap.core.d.ts shows a few errors:

image.png.1c8268f0b4a76eec8b89234fdb38bfb7.png

Link to comment
Share on other sites

  • Solution

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

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!

 

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