5

I am currently debugging a rather strange issue in an angular application on IE11 (Edge). We are using a custom Logger which then writes everything that's necessary through angulars $log Service into the console.

Now in IE11 we have the following behavior:

If we load the page (and thus initialize our Angular app) with the F12 tools open, there is no issue with logging. As soon as we close the F12 tools, subsequent logs apparently trigger a javascript error and no following JS-Code is executed. However since I can't debug it I don't know the error. The only reference I sometimes get when I reopen the devtools is an issue with browsertools.library.js.

If we load the page with our F12 tools closed however, there is no issue at all, even when we open and close the F12 tools again.

This also doesn't happen with other browsers (e.g. Chrome).

Our Angular version is 1.2.18 (company policy...)

Thanks for any hint or solution. Chnoch

Chnoch
  • 772
  • 9
  • 20
  • We noticed the same behavior in IE11 and IE9. It's not an AngularJS issue however, you'd have the same behavior with console.log() –  Mar 06 '15 at 14:47
  • 1
    Not necessarily. I fixed the issue by bypassing angulars $log Service and directly writing to the console from our custom Logger. Apparently there's an issue when applying the respective console function (log, warn, error...) from angular. But it's a seriously weird issue, especially because it's not really debuggable. – Chnoch Mar 07 '15 at 16:20
  • That's weird. We encountered this behavior in an app that had no reference to Angular whatsoever, and we were just doing console.log. –  Mar 07 '15 at 22:12
  • 1
    Not sure it helps but if you're running in an older document mode – Andy Sterland Apr 15 '15 at 22:32
  • @AndySterland Thanks for your comment. It doesn't really help though, since the issue is on IE11. I also knew about said bug before, as I previously ran into it ;-) I suppose it's a bug in AngularJS, because as soon as we got rid of the $log service and directly implemented console.log, console.warn, etc. the bug vanished. So I stopped investigating and also don't have a reproducable to share. – Chnoch Apr 16 '15 at 12:44
  • Bit late but found [this bug report](https://connect.microsoft.com/VisualStudio/feedback/details/878116/unable-to-debug-javascript-in-ie-as-error-in-dynamic-javascript-recieved) has a reference to `browsertools.library.js` in it? – ste2425 Feb 23 '17 at 15:29

1 Answers1

0

It's because of console.log statement. There might be some lines you can comment and it will work. In my case it was xhr request.

var xhttp = new XMLHttpRequest();
Ondrej K.
  • 8,841
  • 11
  • 24
  • 39
JIN T
  • 1