Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

10 $digest() iterations reached using $locationWatch #3915

Closed
fraywing opened this issue Sep 6, 2013 · 12 comments
Closed

10 $digest() iterations reached using $locationWatch #3915

fraywing opened this issue Sep 6, 2013 · 12 comments

Comments

@fraywing
Copy link

fraywing commented Sep 6, 2013

Oh noes! Not this issue again!

I'm using the Zombie headless browser, Nodejs, Angular 1.2.0rc1 and i'm getting the same iteration loop error.

It seems as though this issue is related to #2815
as well as this thread:
https://groups.google.com/forum/#!topic/angular/mRIo8LaTh4M

and the recent change for Boxee Box.

My thought is that there has to be some sort of universal fix instead of making exceptions for each instance where this comes up?

Anybody?

@fraywing
Copy link
Author

fraywing commented Sep 9, 2013

Just to help anybody who has this issue out, I had to make a line addition to the Angular lib after line 11221 with:

headless = $window.navigator.appName == "Node.js jsDom" ? true : false,

and later on line 11253 made the change:

 history: !!($window.history && $window.history.pushState && !(android < 4) && !headless),

@fraywing fraywing closed this as completed Sep 9, 2013
@fraywing fraywing reopened this Sep 9, 2013
@petebacondarwin
Copy link
Member

So the issue is that $location doesn't play well when the browser URL is changed by something outside of the control of Angular. For instance, the browser itself on Android or if you are using some 3rd party library such as jQuery.
I think the issue is explained well in this commit isabo@f44558b but I think that solution and the one here are too specific.

@fraywing
Copy link
Author

I totally agree, I'm only attempting to help those that may be in specific situation, Using Nodejs with Zombie.

Its not a universal fix, and there has been a Boxee Box fix that is as specific as mine stated above, its was merged into the master branch of angular.

I disagree with that move as well, since as you stated, it needs to be a universal fix.

@xrg
Copy link

xrg commented Sep 16, 2013

Please, can we reopen this issue to add more vintage Webkit browsers?

My konqueror 4.6.5 + webkit 1.0 (=533.3, productSub = 20030107) has the same issue.

@oilart
Copy link

oilart commented Dec 5, 2013

Had the same issue when using browser.history API directly. In case you need to change the URL without using $location service etc. you can invoke $browser.url(newURL) first and then do the rest. This worked for me in Angular v1.2 rc3 :

$browser.url( state.url );
history.replaceState({}, state.title, state.url );

@tbosch
Copy link
Contributor

tbosch commented Aug 27, 2014

Hi,
I just landed an fix for a similar issue in master: 3be00df

Could you check if this issue is still there?

@cortezcristian
Copy link

Angular you're not making my testing life easier :(. I'm using:

  • AngularJS v1.3.0
  • Node.JS v0.10.18
  • Zombiejs ~2.0.8

If i do

$location.path('/crud/sample');// it fails

Error trace:

Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!

https://docs.angularjs.org/error/$rootScope/infdig
Basically the ng-view starts repeating more than 10 times:

I'll end up doing somethig awful like:

document.location.href = '#/crud/sample'; //just to make my test pass

Any better idea?

@yanovich
Copy link

yanovich commented Nov 4, 2014

@cortezcristian
zombie behaves differently than FF 33 and Chrome 38. assaf/zombie@038b3c6 for more details.
EDIT: I mean it looks like a zombie, not an angular problem. And it's not solved. I've just pointed to the commit which introduces the present zombie behavior.

@petebacondarwin
Copy link
Member

@cortezcristian - this is possibly related to #9635. Can you look at #9923 - to see if that fixes it?

@yanovich
Copy link

This should now be fixed by @assaf in assaf/zombie@d5f92bd

@wesleycho
Copy link
Contributor

Sounds like this issue probably can be closed now.

@petebacondarwin
Copy link
Member

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants