-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ScrollTrigger Invalid calling object error in IE #412
Comments
Addendum: source file of ScrollTrigger the line changed is:
to
There is no description on how to build. |
Hm, I cannot reproduce that problem at all, and it doesn't really make sense to me. Are you saying that in your version of IE, requestAnimationFrame exists...but it's not a function or something? Do you have some other library that's messing with the default browser behavior maybe? I've tried in IE11, 10, and 9. Zero such errors. Can you tell us more about exactly how to reproduce this problem? Nobody else has reported anything similar either, and I know folks have used it in IE so I wonder if it's something specific to your environment(?) I wouldn't want to change the code to what you suggested because it adds a conditional check on EVERY SINGLE TICK (performance bummer). |
I can't reproduce this either. A minimal demo would be greatly helpful @mrwokkel. |
I stand corrected, following code works in IE11.
Please disregard for now. I have to dig deeper. |
Found it! First the example:
Seems it has something to do with webpack running in hot reload mode (eval). (I am running via webpack) Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this Following that logic (and if you want to support webpack hot reload in IE in strict mode), the change in code should be: Above change works for me, but if I have to provide a test (webpack + hot reload) it will take me some time. I hope it helps |
Thanks for the info. Yeah, I'm reluctant to add that to the official codebase, as I'm not sure how many unintended consequences it'd have (GSAP is used by massive amounts of devices on various browsers, some of which may not even support .bind()). Would an easy fix in your situation be to just do the binding on your own before GSAP loads? Like: window.requestAnimationFrame.bind(window); |
I can imagine the reluctance and it is only an issue during development using webpack.
|
When using ScrollTrigger I get multiple "Invalid calling object" errors. Traced it down and IE does not allow to create the following function alias
_raf = _win.requestAnimationFrame
I Changed the following to remove the error:
In ScrollTrigger.register I changed this
to this:
I'm sorry if I have not followed correct procedures to raise issue. (Time not on my side)
Hope it helps.
Cheers,
John
The text was updated successfully, but these errors were encountered: