Hey all,
We have a website which pulls in gsap the old way and generally works. But seeing as our future sites are going to be all module based I'm trying to pull gsap in and get it working but I seem to be getting the following error below.
import { gsap } from '../vendor/greensock/gsap-core.js';
/* ... */
console.log(gsap);
console.log(arrowBase);
// Animate In
tm = gsap.timeline();
tm.to(arrowBase, { duration: 0.25, top: 100, height: 50 });
Obviously there is more code but I get the following errors. I was wondering if it could be the CSSPlugin but on inspection of the documentation it states it is built into the core now. I added the console logs so you can see the results of gsap and arrowBase.
The actual version of gsap-core.js is version 3.11.1
Is the above a classic miss-understanding with new people trying to use it. I've used it a few years ago but I'm back to newby again right now. I'm not sure if I can make a code pen example unless you can emulate the exact setup of importing a module..? But I'm thinking what I've given is enough for somebody to notice the obvious and give it to me straight
I've found if I do the following it doesn't error but I really need to set a timeline var for this as it states in the documentation as well.
gsap.timeline(arrowBase, { duration: 0.25, top: 100, height: 50 });
Thank you in advance
Duncan