janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.88k stars 2.17k forks source link

TweenMax is not defined #821

Open godiaz opened 6 years ago

godiaz commented 6 years ago

Hi,

I am using ScrollMagic in my Rails app. I have installed 2 npm packages.

  1. ScrollMagic
  2. Gsap

In my application.js files I called: import ScrollMagic from 'scrollmagic' import TweenMax from 'gsap'

Both folders located in my node_modules folder. Now I am getting this error:

(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin 'animation.gsap'. Please make sure to include plugins/animation.gsap.js

Any clue of what it could be? Thanks.

k33n8nc commented 5 years ago

Make sure you FIRST load gsap and SECOND ScrollMagic. scrollmagic depends on gsap so thats why you get this error. So you get:

import TweenMax from 'gsap'
import ScrollMagic from 'scrollmagic'