Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zone errors #14683

Closed
naveedahmed1 opened this issue Feb 23, 2017 · 5 comments
Closed

Zone errors #14683

naveedahmed1 opened this issue Feb 23, 2017 · 5 comments

Comments

@naveedahmed1
Copy link
Contributor

naveedahmed1 commented Feb 23, 2017

**I'm submitting a **

[x] bug report

Current behavior

After upgrading to latest release (2.4.8), I am receiving below error very frequently:

TypeError: Cannot read property 'length' of null
    at Zone._updateTaskCount (http://localhost:49547/content/js/zone.js:224:46)
    at Zone.cancelTask (http://localhost:49547/content/js/zone.js:214:18)
    at http://localhost:49547/content/js/zone.js:1575:31
    at clearInterval (eval at createNamedFn (http://localhost:49547/content/js/zone.js:1483:17), <anonymous>:3:40)
    at eval (http://localhost:49547/content/app/shared/services/http-loading.js:130:17)
    at ZoneDelegate.invokeTask (http://localhost:49547/content/js/zone.js:363:31)
    at Object.onInvokeTask (http://localhost:49547/node_modules/@angular/core/bundles/core.umd.js:3971:41)
    at ZoneDelegate.invokeTask (http://localhost:49547/content/js/zone.js:362:36)
    at Zone.runTask (http://localhost:49547/content/js/zone.js:166:47)
    at ZoneTask.invoke (http://localhost:49547/content/js/zone.js:416:38)
    at data.args.(anonymous function) (http://localhost:49547/content/js/zone.js:1527:25)

Issue seems to be with below blocks of code in zone.js:

Zone.prototype._updateTaskCount = function (task, count) {
            var zoneDelegates = task._zoneDelegates;
            if (count == -1) {
                task._zoneDelegates = null;
            }
            for (var i = 0; i < **zoneDelegates.length**; i++) {
                zoneDelegates[i]._updateTaskCount(task.type, count);
            }
        };
Zone.prototype.cancelTask = function (task) {
            task._transitionTo(canceling, scheduled, running);
            this._zoneDelegate.cancelTask(this, task);
            **this._updateTaskCount(task, -1);**
            task._transitionTo(notScheduled, canceling);
            task.runCount = 0;
            return task;
        };
function createNamedFn(name, delegate) {
    try {
        **return (Function('f', "return function " + name + "(){return f(this, arguments)}"))(delegate);**
    }
    catch (error) {
        // if we fail, we must be CSP, just return delegate.
        return function () {
            return delegate(this, arguments);
        };
    }
}

Please tell us about your environment:

  • Angular version: 2.4.8
@DzmitryShylovich
Copy link
Contributor

pls add a plunkr

@JiaLiPassion
Copy link
Contributor

This is the zone.js issue, I have made a PR to fix this one, angular/zone.js#642

@DzmitryShylovich
Copy link
Contributor

@naveedahmed1 close the issue, as it's not angular related, pls. thx

@naveedahmed1
Copy link
Contributor Author

Thank you

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
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

3 participants