Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Uncaught UnsubscriptionError thrown after first subscribe call on angular beta 13 #310

Closed
tiagoroldao opened this issue Apr 6, 2016 · 5 comments

Comments

@tiagoroldao
Copy link

This seems to be a zone.js problem, as rolling back to 0.6.6 solves the issue - angular's dependency on ^0.6.6 resolves to the latest. Also, seems to happen in angular beta 13, and also beta 12 and beta 8, after rolling back.

@justyns
Copy link

justyns commented Apr 6, 2016

Can confirm I get the same error with angular2 beta 13 and zone.js 0.6.9. I was able to get it working by rolling back to zone.js 0.6.8.

@user414
Copy link

user414 commented Apr 7, 2016

I was driving myself crazy debugging this after upgrading to beta 13 and zonejs 0.6.9 reverting to 0.6.8 also fixed the problem. Here what I had found when I was debugging. The error UnsubscriptionError is not the real error, the real error comes from

 ZoneDelegate.prototype.cancelTask = function (targetZone, task) {
                var value;
                if (this._cancelTaskZS) {
                    value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this.zone, targetZone, task);
                }
                else if (!task.cancelFn) {
                    throw new Error('Task does not support cancellation, or is already canceled.');
                }
                else {
                    value = task.cancelFn(task);
                }
                if (targetZone == this.zone) {
                    // this should not be in the finally block, because exceptions assume not canceled.
                    this._updateTaskCount(task.type, -1);
                }
                return value;
            };

Error: Task does not support cancellation, or is already canceled.(…)

when the cancelFn is null for a source: "XMLHttpRequest.send" and type "macroTask". Hopefully that helps someone else debugging for my part will be content to revert to 0.6.8. Not sure why I don't start with reverting first:) Thanks @tiagoroldao @justyns for solution.

@megalepozy
Copy link

Reverting to zone.js 0.6.8 fixed the issue for me as well! thx @user414

@MarkPieszak
Copy link
Member

Nice catch again @megalepozy !

@megalepozy
Copy link

heheheh thx but I just reconfirmed what @user414 said... :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants