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
1
vote
2 answers

How to stop zone.js swallowing your errors invoke@node_modules/zone.js

I'm running a unit test and its failing with some zone.js gumpf. how can i get the real error? error is ... × should instantiate service PhantomJS 2.1.1 (Windows 7 0.0.0) e invoke@node_modules/zone.js/dist/zone.js:232:31 …
danday74
  • 52,471
  • 49
  • 232
  • 283
0
votes
1 answer

angular2-notification dependency on zone.js after angular update

I upgraded my angular application to v16 and I'm getting below error after running npm install. npm ERR! While resolving: angular2-notifications@12.0.0 npm ERR! Found: zone.js@0.13.1 npm ERR! node_modules/zone.js npm ERR! zone.js@"~0.13.0" from…
jay parekh
  • 9
  • 1
  • 5
0
votes
0 answers

Angular HttpClient error response always Unknown Error, but zone.js shows full error

I am developing a simple healthcheck page on my Angular application. On the page I perform all the healthchecks like this: performHealthchecks() { for (const [service, url] of Object.entries(this.endpoints)) { this.logger.debug(`Checking…
gbos
  • 503
  • 2
  • 6
  • 28
0
votes
1 answer

Patching zone.js doesn't enable passive event listeners

I've written this demo component : (window as any)['__zone_symbol__PASSIVE_EVENTS'] = ['scroll']; import 'zone.js'; import { Component } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; @Component({ …
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
0
votes
0 answers

Error Zone is not defined when doing Karma test

I am trying to test a service in Angular and it keeps throwing this error: An error was thrown in afterAll Uncaught ReferenceError: Zone is not defined ReferenceError: Zone is not defined I have already visit and tried every solution on here…
blanca
  • 1
0
votes
1 answer

How zone.js gives functions a new execution context?

It has been boggling my mind for days and I couldn't figure it out. I was trying to create a simple example as follows: Define a function "run(f)" (in module "zone") which gets another function to run. An specific variable "ctx" be accessible in f…
Siavoshkc
  • 346
  • 2
  • 16
0
votes
0 answers

angular, Storybook throws an error `Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.`

I've setup Storybook in my angular project when I tried to run it throws this error 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…
0
votes
1 answer

Why does Angular's Change Detector not use Proxy objects

Angular (precisely: zone.js) monkey-patches functions like setTimeout(), event listeners and similar, in order to fire the Change Detector when the respective callback got executed. However, Angular does not know which objects got updated and which…
MBuchalik
  • 180
  • 1
  • 8
0
votes
2 answers

error TS2304: Cannot find name '_ZonePrivate'

I'm trying to test my angular 9 application but I'm getting an error when running with ng serve. It says it is running fine but when I try to display the page it says Cannot GET /. Also when I try to build it using ng build it displays the same…
0
votes
2 answers

How to enable zone aware bluebird promises in angular 8?

I'm trying to make all the promises in my angular 8 project cancellable. When looking for a library to fulfill that need I found that bluebird.js looks promising ;-) I then found and followed these instructions on how to integrate bluebird with…
lentschi
  • 300
  • 1
  • 11
0
votes
3 answers

Angular Elements Error: Zone.js has detected that ZoneAwarePromise

I've been testing out Angular Elements. Basically I created 2 angular elements: a simple button and a simple input. You can check them out here: http://kaloyanmanev.com/edo-button.js and http://kaloyanmanev.com/edo-input.js Both of the elements…
0
votes
1 answer

Uncaught (in promise): cordova_not_available by Zone.js

I have @mauron85/cordova-plugin-background-geolocation plugin installed in my ionic 4 app. app is working fine. but when i call the plugin it throw error to my console. I tried some stack overflow and git answers. But still the problem occurs. also…
No One
  • 109
  • 10
0
votes
1 answer

How can I turn off ZoneAwareError in Angular?

I want to turn off ZoneAwareError in Angular for the performance issue. I try to find a solution at the Documents, but I couldn't find it. Are there other APIs to solve this problem?
egaoneko
  • 389
  • 1
  • 5
  • 24
0
votes
0 answers

uncaught Typeerror : promise.fulfill is not a function (Conflict with Zone.js ) (Angular 5)

I have a fileload method the code works when I use it separately from my project, but once I integrate it with my angular 5 projects it doesn't work Error: Code: MM.Backend.File.load = function() { var promise = new Promise(); …
TraiOmar
  • 3
  • 2
0
votes
1 answer

zone.js: how to import zone.js library into node script

I am trying to set up a small node script to play with zone.js. But I am confused about how to require this library into node script. My script goes as following: var Zone = require('zone.js/dist/zone-node.js'); console.log('test...',…
Chris Bao
  • 2,418
  • 8
  • 35
  • 62