When batarang is enabled getting errors on scope $digest #48

Closed
pavelgj opened this Issue Jan 31, 2013 · 8 comments

Projects

None yet

8 participants

@pavelgj
Angular member

When batarang is enabled I consistently see errors in console. The application becomes slow and errors appear many-many times and looks like on each digest cycle. The error is thrown inside the $digest function (inside the try-catch inside watcher while-loop), it's caught by try-catch and delegated to exception handler. I couldn't narrow it down further. But the problem goes away when batarang is disabled.

These are two types of errors that I'm seeing:

RangeError: Maximum call stack size exceeded
at Object.stringify (native)
at derez (http://localhost:8080/index.html:96:39)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30) bundle.js:5619
(anonymous function) bundle.js:5619
(anonymous function) bundle.js:4716
Scope.$digest bundle.js:7820
Scope.$apply bundle.js:8009
$delegate.proto.$apply localhost:500
done bundle.js:9019
completeRequest bundle.js:9159
xhr.onreadystatechange

TypeError: Accessing selectionDirection on an input element that cannot have a selection.
at derez (http://localhost:8080/index.html:95:41)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30)
at derez (http://localhost:8080/index.html:95:30) bundle.js:5619
(anonymous function) bundle.js:5619
(anonymous function) bundle.js:4716
Scope.$digest bundle.js:7820
Scope.$apply bundle.js:8009
$delegate.proto.$apply localhost:500
done bundle.js:9019
completeRequest bundle.js:9159
xhr.onreadystatechange

Using angular 1.0.4.

@pavelgj
Angular member

Opps... looks similar to Issue #47

@darrinm

And #37.

@ultrawebsites

I'm getting the same problem, and I'm not using JSONP (#47) or ng-grid (#37):

My error is:

RangeError: Maximum call stack size exceeded
at MimeType.toString (native)
at derez (http://www.dm.dev/app/#/messages/abc:86:43)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)
at derez (http://www.dm.dev/app/#/messages/abc:95:30)

Chrome inspector states the error is at angular.js line 5687, which is: return logFn.apply(console, args);

I get the exact same error 10 times. It causes Chrome to give the CPU a good workout too, and the app loads really slow during this. With Batarang disabled I don't get the error, and the app loads fast.

Interestingly, when I load the app through 'yeoman server' (the error above is seen when using IIS), whilst the app still loads slow slowly, there are no error messages generated in the console at all for the exact same page/URL. No idea if this is a red herring or not though, thought it may be helpful.

Cheers
Matt

@jeffwhelpley

When I call scope.apply:

scope.$apply(function() {
    scope.someArray.push(someValue);
});

with Batarang turned on I get:

TypeError: Accessing selectionDirection on an input element that cannot have a selection.
    at derez (http://localhost:4000/#/:95:41)
    at derez (http://localhost:4000/#/:95:30)
    at derez (http://localhost:4000/#/:95:30)
    at derez (http://localhost:4000/#/:95:30)
    at decycle (http://localhost:4000/#/:106:10)
    at getScopeLocals (http://localhost:4000/#/:117:33)
    at Object.applyFunction [as fn] (http://localhost:4000/#/:443:47)
    at Object.e.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:85:409)
    at Object.e.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js:87:506)
    at Object.$delegate.__proto__.$apply (http://localhost:4000/#/:500:30)

Once I disable Batarang, the error goes away.

@lpalnau

Also am experiencing this. Installed batarang tonight from Chrome App Store. My app uses angular-ui but not in the controller I'm currently working in. Enable batarang without the error. Add $scope.$digest in a google maps click event handler and error begins appearing. Remove $scope.$digest and error goes away, (but my child scope binding doesn't notice changes). Put $scope.$digest back in and disable batarang and the error goes away.

@btford

Should be fixed in v0.4.0. Let me know if it persists. Thanks!

@btford btford closed this Mar 27, 2013
@keenedge

I am still getting this error with v0.4.0.

@AlexCppns

I just got the same error on version 0.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment