Share Posted January 16 Hi, I've setup my project with sveltekit (used npm create svelte@latest command). I installed gsap with npm and tried a basic animation. It's throwing TypeError: Cannot read properties of undefined (reading 'querySelectorAll') error. How can i resolve this? Link to comment Share on other sites More sharing options...
Share Posted January 16 Welcome to the forums, @leo_svelte. It sounds to me like you're trying to either use GSAP or register plugins BEFORE the document exists (SSR). Make sure you do those AFTER the document exists, like in a lifecycle callback. Here are some Sveltkit demos you can fork to try to recreate the issue: https://stackblitz.com/@GreenSockLearning/collections/gsap-sveltekit-starters Once we see a minimal demo that illustrates the problem, I'm sure we'll have some advice to offer. Happy tweening! 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