SarunasDaunoras
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by SarunasDaunoras
-
-
10 hours ago, GreenSock said:
Sorry, I'm not familiar with Svelte or your particular build process. It's super difficult to troubleshoot without being able to reproduce the error on our end. Have you tried using a relative path to the files? It looks like your editor is hinting at the need for that, like "./gsap/dist/ScrollTrigger.js" for example (I have no idea what your actual folder structure looks like...maybe it'd be more like ./node_modules/gsap/dist/ScrollTrigger.js")
Found the solution. Just in case anyone else has the same problem, here is the code:
import { browser } from '$app/env';import { onMount } from "svelte";onMount(async () => {if (!browser) { return; }const { gsap } = await import('gsap');const { ScrollTrigger } = await import('gsap/ScrollTrigger');gsap.registerPlugin(ScrollTrigger);P.S. Not sure if I should create another post or not, so I'll just ask here. ScrollTrigger gets messed up when navigating the page. It seems that maybe it continues to run? If I refresh the page it goes back to working as it should.
EDIT: is using refresh() in the end the correct thing to do?
ScrollTrigger.refresh();- 1
-
Hi Everyone, hope someone can help me out. I have been struggling with this for a while.
I can't seem to deploy gsap with an npm install.
I tried adding the .js like mentioned in the previous posts, but as soon as I do that, I get errors on ScrollTrigger.create ?
if I don't use the js, I get the error during build process.
Any suggestions?
GSAP SvelteKit Build problems
in GSAP
Posted
It almost works with the scrollTrigger.refresh there is still an occasional flicker. I'm kinda new to svelte and all the js stuff still. What would be the best place to make a demo that would work with sveltekit?