Angular 2 after update I get this error: Cannot read property 'zone' of undefined

Viewed 5603

I just updated angular 2 from beta 9 to beta 11 (or beta 10) and now I get this error in console: Uncaught TypeError: Cannot read property 'zone' of undefined in angular2-polyfills.js:142 without changing anything to code.

The line in angular2-polyfills.js:142 where console report the error is:

task.zone.cancelTask(task);

I am using plain js.

In index.html I include this 4 js files:

<script src="libs/es6-shim/es6-shim.min.js"></script>
<script src="libs/angular/2.0.0-beta.11/angular2-polyfills.js"></script>
<script src="libs/angular/2.0.0-beta.11/Rx.umd.js"></script>
<script src="libs/angular/2.0.0-beta.11/angular2-all.umd.js"></script>

And all ngZone related code that I use is to make a method of a class accesible from external js.

window.PushService = {
            onCallFromOutside: this.onCallFromOutside.bind(this),
            zone: _ngZone
        };

Also I try to comment all code where I use ngZone and the error is still here.

What is related to and how can I fix this error?

5 Answers
Related