Questions tagged [zonejs]

Implements Zones for JavaScript

Links

127 questions
7
votes
1 answer

Angular 4 + zonejs: routing stops working after uncaught error

If there is an uncaught error from a component (constructor or ngOnInit) during routing the navigation won't work anymore afterwards. This happens even if there is an global ErrorHandler and an ErrorHandler for the RouterModule, added an…
Benjamin Seiller
  • 2,875
  • 2
  • 32
  • 42
7
votes
2 answers

Does Angular have the equivalent of React's Virtual DOM?

It is not advised to use Bootstrap directly with React because Bootstrap's JavaScript may alter the DOM directly, interfering with React's Virtual DOM system. Can one say the same about Angular (2+)?
Sammy
  • 3,395
  • 7
  • 49
  • 95
6
votes
3 answers

Angular 2 click event callback without triggering change detection

I'm having major trouble trying to perform some logic inside a (click) event callback function in Angular 2 without triggering change detection. Why I don't want to trigger change detection The callback function performs a simple animated scroll to…
garethdn
  • 12,022
  • 11
  • 49
  • 83
6
votes
5 answers

Get zone-free window methods with Zone.js

Can zone-free window methods (setTimeout, etc) be accessed somehow with loaded Zone.js ? Does Zone.js expose the original unpatched methods? The example of possible use case is Angular 2 app that has some problems with Angular 2 Material data…
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
5
votes
1 answer

Angular 9 project suddenly throws compilation errors when using safe null accessing and null coalescing?

So this is the weirdest thing I've had happen as this project was working perfectly fine yesterday, in fact i even had 'ng serve' still running as i finished my work the day before and everything was fine. Come today, with no changes, I can no…
SebastianG
  • 8,563
  • 8
  • 47
  • 111
5
votes
2 answers

Unable to build since upgrading from Angular 9.17 to 9.19

I upgraded from Angular 9.17 to 9.19 and now ng build fails with the following error complaining about a variable declaration in both @types/node and zone.js: ERROR in node_modules/@types/node/ts3.5/globals.global.d.ts:1:13 - error TS2403:…
LanceM
  • 1,888
  • 4
  • 23
  • 41
5
votes
2 answers

Angular 7: ng serve works, but console shows a Zone.js error and app won't load

Backstory: I needed to update my app from Angular 5.2.9 to 6 yesterday, and so I thought "why not go to 7 while I'm doing this." So of course that took all day, and required lots of changes to lots of files (mostly because of Rxjs), but in any case,…
redOctober13
  • 3,662
  • 6
  • 34
  • 61
5
votes
3 answers

Test generated by angular CLI fails if in a specific folder

I've generated a component in my components folder using the angular CLI (v6.1.4) by running ng g c components/foo and have then run ng test. The test for the new component fails with the following errors: Zone is needed for the async() test helper…
Tim
  • 5,435
  • 7
  • 42
  • 62
5
votes
1 answer

Uncaught RangeError: Maximum call stack size exceeded ONLY on Production

Update Aug. 28: The exact same package configuration below but with zone.js 0.8.16 instead produces no errors. Any idea why? Edit: I've been trying to find out just where the problem is coming from. If this is an endless loop, where exactly does it…
Sammy
  • 3,395
  • 7
  • 49
  • 95
5
votes
1 answer

How to "unwrap" a ZoneAwareError?

In my Angular 2 app I have a resolve guard which tries a xhr and throws a custom error if it fails: return this.service.getProduct (id) .catch (err => Observable.throw(new MyError(err.message, route, 500, err))); MyError is just an extension of…
André
  • 12,497
  • 6
  • 42
  • 44
5
votes
1 answer

Uncaught TypeError: Cannot read property 'ca' of null when dragging Google Map

I have an Ionic 2 beta 7 app (also happens in Beta 6) that uses the Google Maps JavaScript API. If I click down on the map, drag it and "throw" the map before releasing the click, it causes this error to occur on the next attempt at dragging the…
Will.Harris
  • 4,004
  • 2
  • 24
  • 37
4
votes
1 answer

Signalr callbacks are run outside angular zone?

I have a strange problem with signalr and angular. We recently upgraded signalr to use the @microsoft/signalr package instead of the @aspnet/signalr one and we noticed that the callback called by signalr are no longer run in the angular zone. The…
4
votes
1 answer

The same data is displayed differently in angular9.why?

In the following example, the first expression {{ bar }} is never updated, but the second expression {{ "" + bar }} is updated: e.g. two 1588950994873 Why is this the case? import { Component } from "@angular/core"; @Component({ selector:…
Log in
  • 65
  • 6
4
votes
0 answers

Why run outside angular is implicitly called?

I had a similar issue with mat-dialog, I was not able to open/close it. What is interesting is that it works for about 20 minutes after I refresh the component. But after that, it stops working. I read this issue…
TSR
  • 17,242
  • 27
  • 93
  • 197
4
votes
0 answers

Error: Already loaded patch: ZoneAwarePromise

We try to make server side render build for Angular 5 project, then it shows this error. Zone js is loaded on my polyfills.ts , What the problem how to fix it. And i observe same Zone code in twice in mys server.js file, thanks Error: Already loaded…
Zahidur Rahman
  • 1,688
  • 2
  • 20
  • 30
1
2
3
8 9