Inject $location service cause $rootScope:infdig error on Edge 14.14393 (latest) and Angular 1.5.8 when html5mode is on and the page has an Internationalized Domain Name domain #15217
Description
Hello,
Yes, as the title define it "Inject $location service cause $rootScope:infdig error on Edge 14.14393 (latest) and Angular 1.5.8 when html5mode is on and the page have an IDN domain" quite specific and quite complicate to find the issue too.
Before go to the detail
It happen only with the latest version of Edge (14.14393) and the latest version of Angular (1.5.8), if we use ng 1.5.8 and a previous version of Edge the problem doesn't happen, the same if we use ng 1.5.5 and the latest version of Edge. So, I am not totally sure if the problem could be on Edge or Angular, but for sure would be possible to have a workaround to avoid it.
How to reproduce the error
Run the following code in a IDN domain and browse the page using Edge (14.4393)
http://jsfiddle.net/Lvc0u55v/10528/
Web console output:
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 Scope.prototype.$digest (http://währungsrechner.dev/assets/javascript/all.73777e.js:27780:13)
at Scope.prototype.$apply (http://währungsrechner.dev/assets/javascript/all.73777e.js:28008:13)
at done (http://währungsrechner.dev/assets/javascript/all.73777e.js:22049:36)
at completeRequest (http://währungsrechner.dev/assets/javascript/all.73777e.js:22251:7)
at requestLoaded (http://währungsrechner.dev/assets/javascript/all.73777e.js:22184:9) undefined
all.73777e.js (24138,11)
SCRIPT5022: [$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
all.73777e.js (28011,13)
If the domain is not an idn domain (doesn't matter if on the cloud or locally) the error doesn't happen.
If the html5mode is not activated, the error doesn't happen.
Posible fix meanwhile
Downgrade Angular to 1.5.5.
If possible doesn't use html5mode.
If possible doesn't use $location service, use window.location instead.
Some links
Edge 14.14393 (latest): https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ (the version of BrowserStack doesn't throw error because is not the latest)
IDN domain: https://en.wikipedia.org/wiki/Internationalized_domain_name
Since usually Edge is updated automatically to the latest version, this could be a serious bug. Have html5mode activated and use $location service could be a common practice.
Thanks,
J.