Angular 2 - TypeError: Unable to read the "apply" property from undefined

I am developing a very simple Angular 2 application with one component, one service and one interface, but I encountered this error and after several hours of investigation I still can not find the answer.

Uncaught TypeError: Cannot read property 'apply' of undefined
    at XMLHttpRequest.desc.get [as ontimeout] (zone.js:1265)
    at XHRLocalObject.AbstractXHRObject._cleanup (abstract-xhr.js:149)
    at XMLHttpRequest.xhr.onreadystatechange (abstract-xhr.js:125)
    at XMLHttpRequest.wrapFn (zone.js:1230)
    at ZoneDelegate.invokeTask (zone.js:398)
    at Zone.runTask (zone.js:165)
    at XMLHttpRequest.ZoneTask.invoke (zone.js:460)

I canโ€™t understand why the error continues to appear, the application still functions after the error appears, but it is frustrating.

Any ideas?

+6
source share
2 answers

Hi, I had the same problem and I decided to downgrade this to zone.js@0.8.5 and the problem disappeared. Run the following command in the project folder:

npm install zone.js@0.8.5 --save
+17
source

- :

rimraf node_modules
npm cache clear
npm i zone.js@0.8.5
+2

Source: https://habr.com/ru/post/1016692/


All Articles