Skip to content

Angular app gets into an infinite digest loop #6799

Closed
@bertyhell

Description

@bertyhell
  • Electron version: 1.3.2
  • Operating system: Windows 10 64x v1607

I have an offline angular app that i can run with http-server and it works.
But when i switch it over to electron and fix a few issues it gets into an infinite digest loop.
I'm wondering what could cause this since only the environment changed, not the angular code. I read somewhere it could be a template being requested that isn't found because the path should be file:///. Is there any way to verify this.

I also tried to debug the angular unminified code, but i don't understand enough about the watcher list to see which watcher changes value all the time.
These are all the watcher values during the digest cycles:
image

The things that differ between electron and the http-server version are:

// electron
document.write('<base href="file://' + __dirname + '/"/>');
// http-server
document.write('<base href="/"/>');

and

<!-- electron -->
<script>
    window.$ = window.jQuery = require('./js/jquery.js');
    window.bowser = require('./js/bowser.min.js');
</script>

<!-- http-server -->
<script src="./js/jquery.js"></script>
<script src="./js/bowser.min.js"></script>

The exception:

angular.js:13920 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
http://errors.angularjs.org/1.5.8/$rootScope/infdig?p0=10&p1=%5B%5D
    at angular.js:68
    at Scope.$digest (angular.js:17562)
    at Scope.$apply (angular.js:17790)
    at bootstrapApply (angular.js:1761)
    at Object.invoke (angular.js:4718)
    at doBootstrap (angular.js:1759)
    at bootstrap (angular.js:1779)
    at angularInit (angular.js:1664)
    at HTMLDocument.<anonymous> (angular.js:31763)
    at fire (C:\Users\verhe\Documents\storied\resources\pdf\offline\js\jquery.js:3187)(anonymous function) @ angular.js:13920
2016-08-10 10:25:33.150 angular.js:17793 Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
http://errors.angularjs.org/1.5.8/$rootScope/infdig?p0=10&p1=%5B%5D

image

I know this is hard to debug without more code examples, but i'm just looking for some leads why this would occur in electron and not in an http-server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions