-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing Scrollmagic and gsap with npm/webpack #842
Comments
You just have to import the gsap plugin like this
If you wanted to you could create a webpack alias and then you just import like this;
And to create the alias in webpack:
If you are using vue-cli like I am you will have to create a vue.config.js in your project root instead
|
Make sure to install (latest) gsap so that u can use it trough scrollmagic. after that, make sure to FIRST load gsap and SECOND load scrollmagic! If you need more than TweenMax you can comma separate and call anything out of the gsap folder located in your node_modules folder. For example: |
@johanholm I've follow your advice but I still get the same error
the error is at line 31 of animation.gsap.js, this one: I don't know how to fix this on webpack., if anyone have a clue.. |
It cant resolve TweenMax and it cant resolve TimelineMax cause they are loaded after scrollmagic is loaded. So first load gsap (TweenMax and TimelineMax) then load scrollmagic. |
this resolve my problem: #665 |
Hi All, After escalating this issue for 1 month I guess I found great solution.
Before:
After:
Before:
After:
I hope this solution will work for you. |
This is not working for me. I did the same code you've done. just changed the path to my path. |
Can you attach screenshot or piece of code in order to help you ? |
Hi #ilkinnamazov I've done as you say. But I get this mistake: Uncaught TypeError: Cannot read property 'ScrollMagic' of undefined at animation.gsap.js:44 at Module../node_modules/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js In animations.gsap.js import ScrollMagic from "scrollmagic"; is defined but never used. Would be great if you have some ideas |
Hi @dmetree please see updated comment with fix for your issue. |
@dmetree If you got any issue please hit me up at Discord chat : ilkinnamazov#7208 (I can speak Russian). |
Ahhhahhaa! It works! Thank you! @ilkinnamazov |
it works perfectly thank you for the help. |
Just noting here that I fixed this issue with this error
by using the solution presented in #665. I tried the solution from @ilkinnamazov but it requires modifying Thus, I installed I hope this helps for cases where one can't modify |
I found an npm package (published recently) which wraps ScrollMagic with animation.gsap. It solved the problem for me. The package is called scrollmagic-plugin-gsap and can be found here. |
Use ScrollScene, it's an extra layer on top of ScrollMagic as well as using IntersectionObserver to achieve similar effects. |
@siasjustin so please check https://github.com/jonkwheeler/ScrollScene |
This is overdue, since GSAP 3.0 is released and now offers the scrollTrigger plugin. |
Hello Ikinnamazov I am using gsap with Angular 8. |
@AlexPlunkr if you already pull in gsap... why don't you go with the scrollTrigger plugin? |
Thanks a lot Baggio for writing to me and thanks for the advice!! |
That's great! Thank you |
I have read and tried seemingly every approach that exists to import ScrollMagic with gsap while using webpack on the frontend, but I cannot get past this error for the life of me:
(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin 'animation.gsap'. Please make sure to include plugins/animation.gsap.js
Can you please share the current best practice for this, in terms of imports, aliases, and loaders?
The text was updated successfully, but these errors were encountered: