Weird errors on production (using Kadira)

I’ve encountered some strange errors in production environment, that I didn’t saw personally (just logs on Kadira). Am I using latest Kadira packages and zones package.

Here’s one:

Error: Script error.
Error:
at window.onerror (:0:0)

For this one I don’t have a clue what’s the cause. It only happened once, to one client who was requesting root URL. No userId was logged. It happened on Safari (WebKit) - 6.2.8 (which is quite old) using Mac OS - 10.8.5.

And here’s another:

Error: JSON Parse error: Unrecognized token '<'
Stack:
parse@[native code]
onfinish@…
emit@…
onreadystatechange@…

This one occurred also only once, to a registered client using one of the routes that I have (using Flow Router, these are normal routes for navigating the app). There is also a similar error that was logged several times:

App Loaded into Browser
after 5 ms
Inside “setTimeout”

after 7 ms
Error: JSON Parse error: Unrecognized token '<'
Stack:
parse@[native code]

Is it normal to see such errors in production? Note that these occur seldom, the app works normally otherwise and I personally never stumbled on them. My first guess would be some network problems that lead to malformed response from server. But maybe you guys will have a better idea.

All help is appreciated :slightly_smiling:.

Remove zones! It does more damage than good.

Can you elaborate? While Kadira folks admit there might be some edge cases with using zones, they say that they are using it themselves and so far it works fine for them.

Also, zones provide invaluable amount of information when investigating error reports on Kadira, which helps to resolve issues that otherwise would be very hard to track.

Well I hit similar problems with zones and @arunoda himself admitted that zones is buggy and that they don’t advise using it.

In fact, zones messed up a lot of UI functionality of our app as soon as it was added. And all problems went away when it was removed. This is probably due to it “hijacking” the context.

I’m not saying that zone.js in particular is buggy. It is not. But it is also something that can be used implicitly as a drop-in. It needs to be used explicitly, depending on its own api’s.