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
"Error calling method 'setTween()' [...]" with v1.2.1 #182
Comments
Hi Marco, The error occurs if the element can not be added as a Tween. As for mixing the versions this may very well be because 1.1.x is not 100% compatible with 1.0.x. |
Hi Jan Many thanks for the speedy response! I apologise that I wasn't able to isolate the problem before I originally posted this. Just really didn't think of that at all. Best |
Hi Marco, thanks for getting to the bottom of this. regards, |
Hi Marco, I did however correct the error handling for this case and future users will have a better idea of what went wrong. Thank you for your help in getting to the bottom of this. regards, |
Seems I fell in this trap, too ;) Thanks for the explanation on how to fix it |
I'm getting this issue as well. I'm making a single page app with Webpack and Angular. Currently using ScrollMagic 2.0.5, GSAP 1.18.2. Setup of my code: All the page routes are broken up into chunks to allow conditional loading of the site. I mention this because it's making working with 3rd party frameworks like this a bit more complicated to work with. Anyway, adding in the correct WP aliases (from this comment) I finally got the debug indicators working. However, on trying to add a GSAP tween via setTween() I get the same error as the OP.
I've confirmed that the tween itself does run without adding it to ScrollMagic, so I doubt that's the issue. I wonder if it has something to do with gsap not returning a global TweenMax variable when I require it. This is how I call a tween:
I look at the animation.gsap.js plugin and it's expecting "TweenMax" to just be available, but when I log out the "TweenMax" variable, it's returning the wrapper "gsap" object, so it has the easing functions, TweenMax class instance, etc, instead of the "to", "from", functions. I'm super new to this require world so I may just be completely misunderstanding how to load certain packages like this. For reference, here's the module I'm trying to use this in: (being used as an Angular directive)
|
@famicomboy did you take care of the AMD loading style? E.g. Require.js or System.js or browserify. |
I'm a little unsure on that. I see that scrollmagic itself uses the define() method that webpack is looking for, but other than that I'm just using the require() method to load it. |
Sorry everyone, I figured out my issue was unrelated to ScrollMagic. I apologize, this probably should've been a Stack Overflow post but I saw that this issue was the same error I was getting so thought it was better to put here. |
Could you still provide some insights for others who get caught by the same mistake? |
The problem is I started out with this yeoman generator which installed a loader for GSAP files: This was wrapping the module up in a container, making the TweenMax, TimelineMax etc variables inaccessible when loaded with require(); Disabling this loader made the dependent variables accessible to the animation plugin. |
Hi
I'm having an issue with the latest (1.2.1) version of the ingenious ScrollMagic.
Following my JS...
...resulting in the following console-log:
Thing is that if I go with version 1.0.9 the error disappears. With version 1.0.9 for the core and the latest (v1.2.1) debug extension I get the following Uncaught Type Error:
I hope this of any use.
Thank you heaps for ScrollMagic. I'm a huge fan.
Cheers
Marco
The text was updated successfully, but these errors were encountered: