<p dir="auto">I am using the Chart.js library which does auto-sizing of the chart on window resize. It does that by using setTimeout() and clearTimeout() when the event is triggered.</p>
<p dir="auto">The <code class="notranslate">clearTimeout</code> is tripping zone.js</p>
<p dir="auto">Plunkr: <a href="http://plnkr.co/edit/JZMytm59PPlYq3bdSoHy" rel="nofollow">http://plnkr.co/edit/JZMytm59PPlYq3bdSoHy</a></p>
<p dir="auto">Not sure if this is an issue with Angular or Zone or Chart.js. I tested chart.js independently and it works fine for window resize, when not inside an Angular component.</p>
<p dir="auto">[x] bug report</p>
<p dir="auto">Either of these will crash zones</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var timerId = 42; // anything that isn't actually a handle
clearInterval(timerId);
// Error: cannot read property 'cancelTask' of undefined"><pre class="notranslate"><code class="notranslate">var timerId = 42; // anything that isn't actually a handle
clearInterval(timerId);
// Error: cannot read property 'cancelTask' of undefined
</code></pre></div>
<p dir="auto">and try this</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var timerId = setInterval(()=&gt;{},1000);
clearInterval(timerId); // clears the first timer
clearInterval(timerId); // called twice ... boom!
// Uncaught Error: Task does not support cancellation, or is already canceled."><pre class="notranslate"><code class="notranslate">var timerId = setInterval(()=&gt;{},1000);
clearInterval(timerId); // clears the first timer
clearInterval(timerId); // called twice ... boom!
// Uncaught Error: Task does not support cancellation, or is already canceled.
</code></pre></div>
<p dir="auto"><code class="notranslate">clearInterval</code> is supposed to be safe in both cases`. It worked in beta.9</p>
<p dir="auto">Here it is in a plunker:<br>
<a href="http://plnkr.co/edit/nyQIKU4JzTlwp5eOG7Qo?p=preview" rel="nofollow">http://plnkr.co/edit/nyQIKU4JzTlwp5eOG7Qo?p=preview</a></p>
<p dir="auto">Discovered while testing the docs "Cookbook Component Communication" sample. Here it is in the context of that cutdown sample:<br>
<a href="http://plnkr.co/edit/pYlQdKk6qLOGhQwSreoG?p=preview" rel="nofollow">http://plnkr.co/edit/pYlQdKk6qLOGhQwSreoG?p=preview</a></p>