scrollmagic-plugin-gsap icon indicating copy to clipboard operation
scrollmagic-plugin-gsap copied to clipboard

tween was overwritten by another

Open niklasgrewe opened this issue 5 years ago • 2 comments

I am using scrollmagic and gsap in svelte component like this:

//Hero Component
<script>
   import { onMount } from 'svelte'
   import ScrollMagic from 'scrollmagic'
   import { TweenMax } from 'gsap'
   import { ScrollMagicPluginGsap } from "scrollmagic-plugin-gsap";

   ScrollMagicPluginGsap(ScrollMagic, TweenMax);

   let imgContainer;
   let image;

   onMount(() => {
        TweenMax.defaultOverwride = false;
        var controller = new ScrollMagic.Controller();
        var imageScene = new ScrollMagic.Scene({
            offset: 0,
            duration: 500
        })
            .setTween(TweenMax.fromTo(imgContainer, 0.2, {scale: 2.1}, {scale: 1, overwrite: false}))
            .addTo(controller);
    })
</script>

<div bind:this={imgContainer}>
  <img bind:this={image} src="/path/to/image" />
</div>

I load the Component like this:

<script>
	import { onMount } from 'svelte';

	let MyComponent;

	onMount(async () => {
		const module = await import('my-non-ssr-component');
		MyComponent = module.default;
	});
</script>

<svelte:component this={MyComponent} foo="bar"/>

So but when i start scrolling i get the error: tween was overwritten by another I know the scrollmagic guide about this but the solutions doesn't work in my environment.

Any ideas, how can i fix that?

niklasgrewe avatar Mar 12 '20 21:03 niklasgrewe

@epranka Update: the error seems to be related to GSAP3 When I use GSAP version 2, I don't get this warning...

niklasgrewe avatar Mar 14 '20 18:03 niklasgrewe

any updates?

tagging @epranka

WisdomSky avatar Apr 18 '20 23:04 WisdomSky