Questions tagged [zone.js]

A Zone is an execution context that persists across async tasks. You can think of it as thread-local storage for JavaScript VMs.

Zone API is inspired by Dart and is developed along with Angular2.

https://github.com/angular/zone.js/

148 questions
6
votes
3 answers

Custom global error handler not hit when http error response is re-thrown by rxjs throwError

Aim: to have a global error handler for server errors and app errors (produced in Typescript code). How: providing a custom ErrorHandler from a lib project inside the same workspace. This is my lib structure: I have following http-interceptor…
6
votes
1 answer

Angular 2 Change Detection and Zone are Different in Cordova App

We are building an application using Cordova and Angular 2. I have the following code: import { Component, OnInit, ChangeDetectorRef, NgZone } from '@angular/core'; import { Location } from '@angular/common'; declare var WL : any; …
Derek Daley
  • 160
  • 8
5
votes
1 answer

How to disable zone.js in a standalone angular apllication?

when launching angular with a standalone component like bootstrapApplication(AppComponent,{... how can we set the ngZone parameter With modules it goes like: platformBrowserDynamic() .bootstrapModule(AppModule, { ngZone: 'noop'…
Eiswind
  • 71
  • 3
5
votes
2 answers

Since Angular 11.0.3, e2e tests produce error

Since 11.0.3 angular/core version, E2E tests are not working on a project with the default configuration. I open an issue https://github.com/angular/angular/issues/40221 but it seem it's not a regression (?) Minimal…
5
votes
1 answer

ngOnInit is not triggering after disabling zone.js in Angular 5

I recently upgraded my Angular app from 4.3 to 5.0 and trying to play around some of the new features in it. One of them is removing dependancy from zone.js. main.ts: platformBrowserDynamic().bootstrapModule(AppModule, { ngZone:…
5
votes
3 answers

Angular 4.x + Cordova : FileReader fails silently (white screen of death)

I have an Angular 4.3 + Cordova application that used to work very well. But now, I get a blank screen on app start-up, and nothing happens any more. After digging a while I realized where it comes from : my home page is protected by a CanActivate…
n00dl3
  • 21,213
  • 7
  • 66
  • 76
4
votes
2 answers

How to resolve "Unhandled Promise Rejection: NotSupportedError: The operation is not supported." in Safari - Angular?

I'm getting the above error only in the Safari browser, which is not happening in my local machine to debug. I removed the minified version of the build while digging further and the error seems to be from Zone.js. I'm unable to debug further and…
4
votes
3 answers

SharePoint Online /Angular - Error: Uncaught Error: Zone already loaded

I have created project in Angular and added in SharePoint page using Content Editor. It was worked correctly till yesterday. but it throwing below error while loading the page. zone-evergreen.js:42 Uncaught Error: Zone already loaded. at…
Raj Gohel
  • 999
  • 7
  • 14
4
votes
1 answer

Zone.js has high CPU usage even when idle

I have a question about zone.js in Angular. I have built an electron application using Angular (which uses zone.js), and it turns out that when the application is running, it uses up to 15% of the CPU, even though I am not doing anything in the app.…
Samuel Imolorhe
  • 664
  • 4
  • 10
4
votes
1 answer

Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded

Error I get Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when…
Abhiz
  • 970
  • 1
  • 16
  • 36
4
votes
1 answer

Angular7 slow performance on Google Page Speed due to zone.js

I use Angular 7 as ssr, and we found out that our application has heavy and serious problems with Google Page Speed and all the issues are funnelling to zone.js Page speed complain about the script valuation is too high, after breaking down the app,…
jcdsr
  • 1,123
  • 1
  • 17
  • 35
4
votes
0 answers

Trigger router.navigate from console

I'm debugging an angular 7 app and i need to switch routes from the browser console. I was able to get into the Router service as explained in this answer however when i do router.navigate(['customer']); I get a warning saying: Navigation…
4
votes
2 answers

Why is Zone.js changing how AngularJS evaluates attributes?

I have an app with both Angular (2+) and AngularJS (1.x). We are using a third party AngularJS library that reads an object from its attrs array in a link function, like so: //3rd party lib code: module.directive('test', () => ({ template: `Look…
Ryan Silva
  • 925
  • 2
  • 9
  • 17
4
votes
1 answer

The angular http request is sent twice at the same time

I used angluar4 http, Such as login request server, When I click the button to submit the form, Google Chrome's network to capture the two requests, one of which is zone.js: 2744 (the return of the data is wrong). Why is there twice? My code…
ChiakiYu
  • 905
  • 1
  • 8
  • 7
4
votes
2 answers

How to remove HeadlessChrome Log messages from my Karma logs

I'm running an Angular app and my unit tests are workingas expected though every time I run the tests I get all this warnings: HeadlessChrome 0.0.0 (Mac OS X 10.12.6) LOG: '>>>>>>', '', 'Error: STACKTRACE TRACKING' HeadlessChrome 0.0.0 (Mac OS X…
Vassilis Pits
  • 3,788
  • 4
  • 33
  • 48
1
2
3
9 10