Edit: It seems that this could be related to Chrome v43, I downgraded to v42 and everything works fine.
Edit: I've submitted an issue on the Angular's Github repo.
It seems that the error gets thrown by
return logFn.apply(console, args);
line 12221
in angular.js source.
Here's a link to the Chromium bug.
Any tips on what to do now?
I'm trying to migrate my app from AngularJS v1.2 to either v1.3 or v1.4 but I'm getting TypeError: Illegal invocation
on Chrome (tried win, osx and ubuntu).
The stack trace isn't really helping:
TypeError: Illegal invocation
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at Scope.$get.Scope.$digest (angular.js:15550)
at Scope.$get.Scope.$apply (angular.js:15824)
at done (angular.js:10263)
at pleteRequest (angular.js:10435)
at XMLHttpRequest.requestLoaded (angular.js:10376)
So this seems something to do with AJAX requests, but I'm also getting:
TypeError: Illegal invocation
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at Scope.$get.Scope.$digest (angular.js:15550)
at Scope.$get.Scope.$apply (angular.js:15824)
at tick (angular.js:10983)
I'm using $interval
to update a model class (which is a factory and reflected in the views through setting the $scope.client
to this class):
var runTimer = function () {
self.timeOnline = time(self.timeSoFar);
self.timeSoFar = Date.now() / 1000 - self.alarmTriggeredTime;
};
$interval(runTimer, 1000);
I think there's an issue with $digest/$apply
. I've spent hours debugging this, but still haven't got a clue on what's happening.
Any pointers into further debugging is much appreciated.
Edit: It seems that this could be related to Chrome v43, I downgraded to v42 and everything works fine.
Edit: I've submitted an issue on the Angular's Github repo.
It seems that the error gets thrown by
return logFn.apply(console, args);
line 12221
in angular.js source.
Here's a link to the Chromium bug.
Any tips on what to do now?
I'm trying to migrate my app from AngularJS v1.2 to either v1.3 or v1.4 but I'm getting TypeError: Illegal invocation
on Chrome (tried win, osx and ubuntu).
The stack trace isn't really helping:
TypeError: Illegal invocation
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at Scope.$get.Scope.$digest (angular.js:15550)
at Scope.$get.Scope.$apply (angular.js:15824)
at done (angular.js:10263)
at pleteRequest (angular.js:10435)
at XMLHttpRequest.requestLoaded (angular.js:10376)
So this seems something to do with AJAX requests, but I'm also getting:
TypeError: Illegal invocation
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at equals (angular.js:1034)
at Scope.$get.Scope.$digest (angular.js:15550)
at Scope.$get.Scope.$apply (angular.js:15824)
at tick (angular.js:10983)
I'm using $interval
to update a model class (which is a factory and reflected in the views through setting the $scope.client
to this class):
var runTimer = function () {
self.timeOnline = time(self.timeSoFar);
self.timeSoFar = Date.now() / 1000 - self.alarmTriggeredTime;
};
$interval(runTimer, 1000);
I think there's an issue with $digest/$apply
. I've spent hours debugging this, but still haven't got a clue on what's happening.
Any pointers into further debugging is much appreciated.
Share Improve this question edited Jul 28, 2015 at 11:49 Ignas asked Jun 1, 2015 at 16:37 IgnasIgnas 1,9652 gold badges17 silver badges44 bronze badges 9- 1 Coincidentally enough, we've been getting JS errors (not Jquery), on our end with Chrome as recently as last week. See if you can get an older version of Chrome from a month ago and test it? – Compass Commented Jun 1, 2015 at 16:45
- Good point. I'm trying that now. – Ignas Commented Jun 1, 2015 at 16:50
- 2 Weird thing is, these errors don't affect the functionality, they just get spit into the console. – Ignas Commented Jun 1, 2015 at 16:52
-
Yup, this is it. It's working perfectly fine with
42.0.2311.135
. – Ignas Commented Jun 1, 2015 at 16:59 -
1
All I know is that when I get that error it's usually because a built in function like console.log was called with the wrong context. If you invoke that function with
this
set to window, undefined or something else then you will get that error. – arjabbar Commented Jun 2, 2015 at 19:29
1 Answer
Reset to default 2Between the angular-issue, the chromium-bug, the webkit-bug and the (I dont even know what this is) something-Webkit-issue it would appear as if everyone (well, mostly everyone) is throwing their hands in the air. Perhaps I'm being judgemental/plain wrong in saying that.
Anyway, I wasn't able to get the window.history.back
case to log without causing an Illegal Invocation
but I was able to do console.log.call(window, 'x')
with the following 'snippet:'
(function() { console.log = console.log.bind(console); }());
(taken straight off of the last link there, thanks Brian!)
Just slap that out in the top of your HTML document/wherever you want (I guess).
I'm super curious as to what would happen if you were to run that @Ignas. I cannot seem to replicate the issue you are presenting with a Factory binding to $scope
and running that $interval
of yours.
Would love to see if it holds any effect (albeit, not a functional one but more so a decorative one, I suppose).
Sidenote; Me being the newbie I am, I was just informed by my peers that console.log.call(window) shall indeed throw an Illegal Invocation error, so that is a non-issue afaic. Still curious as to if this would hold effect on the logFn
inside Angular.