spirit icon indicating copy to clipboard operation
spirit copied to clipboard

gsap not found in Angular project

Open seaBubble opened this issue 5 years ago • 1 comments

I have an Angular project and I am trying to import a Spirit animation.

I have installed the spirit npm package via npm i spiritjs

I have added the script to the list of loaded scripts "scripts": ["./node_modules/spiritjs/dist/spirit.js"]

Now, when I try to import the module into one of my modules and use it in appComponent: import * as spirit from 'spiritjs';

constructor() { spirit.loadAnimation({...}) }

TS throws 2 errors: ERROR in node_modules/spiritjs/spiritjs.d.ts(1,64): error TS2307: Cannot find module 'gsap'. src/app.component.ts(24,12): error TS2339: Property 'loadAnimation' does not exist on type 'SpiritStatic'.

seaBubble avatar Jul 30 '19 23:07 seaBubble

I assume that you loaded the wrong package.

This is the spirit webserver. The animation tool "spirit" is there.

Lichtjaeger avatar Jul 31 '19 04:07 Lichtjaeger