-
-
Notifications
You must be signed in to change notification settings - Fork 33.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
"Invalid calling object" error in IE #4465
Comments
As an addendum I can also fix it purely in my own code by |
Hello @zakalwe314 , I tried to reproduce this issue but I can't. |
Thanks for looking into this. I'll checkout your jsfiddle and get back to you. We had the problem in both of our apps in testing on ie - however they are also both quite large so I didn't have much luck isolating the problem last time, but I will try some more. |
OK, so I think I know what is hapenning, and unfortunately I don't know how to reproduce it on jsfiddle. basically my code is built with webpack and "use strict" is the case everywhere. According to mdn when a method is called with an undefiend this (which is the case here) then when NOT in strict mode then this=window however when It would seem that the call to raf detached from the window object should, then, in strict mode throw the error I see and it would be best practice to fix it. It would also seem to be the case that in everything except ie that all is good. I'm testing the code using the standard vue builder and Is that enough evidence of an issue to get it fixed? |
|
Following a fix for v1 at vuejs#4274 for issue vuejs#4465
with eval-source-map mode of webpack-dev-server close #7060 ref vuejs/vue#4465
Still running into this error in IE Edge. |
Vue.js version
1.0.28
Reproduction Link
I've identified what is needed to fix the bug and I think, by inspection, it is the right thing to do. Producing a fiddle to reproduce this is somewhat complex and seems out of proportion to the fix, however if I absolutely have to then I will.
Steps to reproduce
Where there is an app with dynamic elements with transitions defined with callback hooks on the transitions, open it in IE (tested in 11 and 9,10 through emulation. No problem in other browsers)
What is Expected?
The transition completes with the hooks called at the right times.
What is actually happening?
The transition does not complete and an error is thrown in Vue: "Invalid calling object" on this code (which starts on line 37 src/transition.js, the error is thrown on line 40):
The error seems to be because the
requestAnimationFrame
method of thewindow
object is being called without its parent object.What seems to fix it?
By changing line 37 to
the error goes away. Using bind seems, to me, obviously correct. Clealy in other browsers because the default
this
is thewindow
object anyway it should not matter, however IE seems to take a dislike to this approach and throw the error. Binding window to the method would seem harmless otherwise.I'm an old-hand at coding but new to github (and relatively new to JS and vue) - The fix works but I don't really know if there are other reasons why this is not a good idea so I'm cautious about just closing it.
The text was updated successfully, but these errors were encountered: