-
Notifications
You must be signed in to change notification settings - Fork 408
"More tasks executed then were scheduled" exception thrown #287
Comments
Could you post a reproduction in a plunker? This wouldn't wholly surprise me but I can't reproduce it. |
@robwormald happens when using this lib https://github.com/stabzs/Angular2-Toaster as well, after the notification timeouts and is about to disappear |
+1 seeing same issues |
I will add that this seems to have started in 0.10... |
FYI disabled snippet is a workaround until issue is fixed in zone.ts
|
Happens with my app as well, all the time. I'm not using anything related to Google Maps, so I guess it's completely irrelevant to the subject. Probably the title should be altered to better match the subject. @born2net: What do you mean by "disabled snippet"? I there any workaround over this issue without touching Zone.js? I'm not sure if it's related, but I'm also receiving exceptions about Task cancellation: at ZoneDelegate.cancelTask (eval at (http://localhost:8080/polyfills.bundle.js:1106:2), :218:23) |
yes I removed the above code from the zone file so it does not error... for now.. |
Installed angular beta9. Same issue.... |
still same issue in 0.12
|
did you just downgrade Angular version, or the Zone.js version too? I'm pretty sure I didn't have any problems with our rather large application in beta.9 (apart from the obvious: minifying broken etc., but those are easy to overcome). EDIT: I'm using ~latest version of Angular2-webpack-starter, and I needed to downgrade only Angular & Zone versions as well as older polyfills.ts accordingly to get rid of all errors. EDIT2: This issue is still completely unrelated to usage of Google Maps Javascript API, as also proved by the plunker above. Though it's possible that this is somehow related to any use of an external library, such as jQuery, as is the case with above plunker and my own code. |
no luck with b12 and 0.6.6, it's still throwing the error, the only difference is that it's not triggering debugger |
this is a big showstopper for me... ng team, PLEASE remove the Throw Exceptions in zone.js Regards, Sean |
I am getting this on beta-12 - it happens when using angular2-moment, specifically the timeago pipe but not consistently. It "feels" like it's when things are rendered and removed a few times but I haven't tracked it down yet. Bizarrely, turning on source-maps to diagnose the problem seemed to make it happen less (possibly random chance or my imagination). |
@mdekrey could you edit the title of the issue to make it easier to find please? Something like By the way this is being tracked here also angular/angular#7721 |
@CaptainCodeman I am also experiencing this with my timeAgo pipe, only became an issue when upgrading to beta12. |
same here, beta.13, latest everything |
Latest zone.js (0.6.8?) with ng2 beta.13 fixed this for me. I think that the main problem is in zone.js version 0.6.7. |
Look at the other (duplicate) issue for instructions how to setup Angular2 beta.13 with Zone.js version 0.6.8: |
I'm still seeing this in 0.6.9. I've got a component that does
|
@Tragetaschen first you need a reproduction of your issue, and second you shouldn't be using angular2's internal api. |
Yeah, I have replaced those by just |
I have seen this again today with the SignalR client, but I cannot reproduce this. In my component in The call stack looks exactly like the one I already posted (with a different component), but it doesn't happen in any reliable way. Nothing I tried so far was able to trigger it, including doing the same steps in the browser again (and again, and again) with my application. |
Use Angular to "2.0.0-beta.14" with zone "0.6.10" in my package.json and I run npm install. It fix the issue. |
@kanchansingh1123 Odd, I am using "2.0.0-beta.14" with zone "0.6.10" and the issue still persists with angular2-toaster project. |
I am using angular2-webpack-starter and it works fine. |
@fxck Figured out why angular2-toaster is causing this exception. If you call clearTimeout in the setTimeout callback, it will trigger this exception. This is exactly what removeToast() is doing. |
Press test and wait for a few seconds: plunker It seems that there are few bugs that lead to the same exception, i would suggest to create debug version of zone to trace this bugs. |
@kemsky Perfect, and thanks for a repro. |
See angular/zone.js#287 for more details, including the solution I used here. Signed-off-by: Josh Black <raskchanky@gmail.com>
See angular/zone.js#287 for more details, including the solution I used here. Signed-off-by: Josh Black <raskchanky@gmail.com>
See angular/zone.js#287 for more details, including the solution I used here. Signed-off-by: Josh Black <raskchanky@gmail.com>
See angular/zone.js#287 for more details, including the solution I used here. Signed-off-by: Josh Black <raskchanky@gmail.com>
Remove exception being thrown Fixes angular#287
@mhevery I ran into this same issue while working with Mapbox-gl integrated into our app. Unfortunately, when the exception gets thrown, the app becomes unusable. I tracked this down to promise chains not resolving after the exception is thrown. I followed the recommendation of removing the line that throws the exception, although I don't feel comfortable about it, but it does remove the problem. I'm happy to help you debug further, but I would like to know why an exception is thrown here. Obviously it's not a condition expected to be hit, but I can see that the other parts of the zone code that use the _updateTaskCount() function are using it outside of the try blocks (and calling it in finally). It would be better to gracefully handle this condition, or at least provide a recommendation on what should be done to catch this exception and do something about it in the app. |
For this plunker provided by @kemsky, the error can be described as the following test case Zone.current.fork({name:'test'}).run(function() {
var req = new XMLHttpRequest();
req.open('get', '/', true);
req.send();
req.onloadend = function() {
req.open('get', '/', true);
req.send();
} readystatechange eventhandler was added multiple times, https://github.com/angular/zone.js/blob/master/lib/browser/browser.ts#L66, I made a PR #527 to fix it. |
@JiaLiPassion I confirmed your change fixes the issue that I see. I'll be eager to see your fix merged in so I can use it. |
@mlmassey thank you for confirm the issue, I think the error code means it should never be executed, if such kind of error occurs, something must be wrong and not recoverable (running task is much more than scheduled task). So I think we should make sure that all bugs are fixed so the code will never run. |
same error in 0.7.2. like @garethdn I am using Marketo tracking plugin.
safe enough? |
@alsh76 no, I don't think comment out the error thrown code is safe, maybe the update count part's behavior will be ok with such workaround, but the real reason cause next <0 will get other problem. for example the xmlhttprequest addEventListener was triggered multipletimes may cause same handler logic run multipletimes. So in my understanding the error part is really a mechanism to avoid further bigger error. |
@alsh76 Version 0.7.2 doesn't have that fix. https://github.com/angular/zone.js/blob/v0.7.2/lib/zone.ts#L869 |
So what would be the best workaround for the issue? I do not want to modify |
Could someone create a plunker which demonstrates the issue. None of the plunkers listed reproduce the issue for me. |
@mhevery here is the plunker |
This fix did not resolve the conflict with Marketo tracking plugin. same error |
@alsh76 |
@JiaLiPassion I'm getting the exact same error once I try to use Tealium which is a tag management system and marketo is actually one of the dependencies on it: https://plnkr.co/edit/seTYkcMqHNlTu9d86AOy?p=preview Stack:
|
@RicardoVaranda , Thank you for your demo, I will debug into it. |
See angular/zone.js#287 for more details, including the solution I used here. Signed-off-by: Josh Black <raskchanky@gmail.com>
First off, I'll admit to not knowing whether this is an Angular2 or Zone.js issue. Sorry if I'm putting it in the wrong Issues list!
When loading the Google Maps API asynchronously, setTimeout and clearTimeout appear to be called which causes the error
More tasks executed then were scheduled.
When I load it before the zone.js library, I am able to get further in the process. However, callbacks threw similar errors (eventually) without further instrumentation. (I'm not sure if this is expected, but I suspect it is. I figured I'd mention it just in case.)
I have not been able to resolve, however, that the error occurs again if I leave the window and return upon moving my mouse over the map again. This event appears to be wholly internal to Google Maps, and I can't capture it. Unfortunately, due to the
debugger;
line in the code, I'm unable to just ignore it for the time being without altering the codebase.I'm using Angular 2.0.0-beta.11 and zone.js 0.6.4.
The text was updated successfully, but these errors were encountered: