0

I've just been thrown this ugly error and I'm not too sure how to start debugging it? I've looked at the code in zone.js or the other files below, but that doesn't say too many things at a first glance.

As I understand from this code is that the drainMicroTaskQueue in Zone.js is failing. But where do I go from here. Can't really determine why it is failing without tryint to understand this Zone.js in detail.

Any tips on how I could continue investigating this?

ERROR Error: "Uncaught (in promise): TypeError: value is null
applyUpdate@webpack-internal:///./node_modules/@angular/common/esm2015/http.js:286:1
init/<@webpack-internal:///./node_modules/@angular/common/esm2015/http.js:246:51
init@webpack-internal:///./node_modules/@angular/common/esm2015/http.js:246:17
forEach@webpack-internal:///./node_modules/@angular/common/esm2015/http.js:323:9
handle/<@webpack-internal:///./node_modules/@angular/common/esm2015/http.js:1753:13
_trySubscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:175:20
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:163:88
call@webpack-internal:///./node_modules/rxjs/_esm2015/operators/tap.js:58:16
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:160:13
call@webpack-internal:///./node_modules/rxjs/_esm2015/operators/catchError.js:75:16
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:160:13
subscribeToResult@webpack-internal:///./node_modules/rxjs/_esm2015/util/subscribeToResult.js:31:20
_innerSub@webpack-internal:///./node_modules/rxjs/_esm2015/operators/mergeMap.js:124:18
_tryNext@webpack-internal:///./node_modules/rxjs/_esm2015/operators/mergeMap.js:121:9
_next@webpack-internal:///./node_modules/rxjs/_esm2015/operators/mergeMap.js:104:13
next@webpack-internal:///./node_modules/rxjs/_esm2015/Subscriber.js:87:13
_subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/observable/ScalarObservable.js:43:13
_trySubscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:175:20
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:163:88
call@webpack-internal:///./node_modules/rxjs/_esm2015/operators/mergeMap.js:81:16
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:160:13
call@webpack-internal:///./node_modules/rxjs/_esm2015/operators/filter.js:55:16
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:160:13
call@webpack-internal:///./node_modules/rxjs/_esm2015/operators/map.js:51:16
subscribe@webpack-internal:///./node_modules/rxjs/_esm2015/Observable.js:160:13
setNavItem@webpack-internal:///./src/app/shared/components/app-header/app-header.component.ts:36:13
ngOnInit/<@webpack-internal:///./src/app/shared/components/app-header/app-header.component.ts:90:17
__tryOrUnsub@webpack-internal:///./node_modules/rxjs/_esm2015/Subscriber.js:234:13
next@webpack-internal:///./node_modules/rxjs/_esm2015/Subscriber.js:182:17
_next@webpack-internal:///./node_modules/rxjs/_esm2015/Subscriber.js:123:9
next@webpack-internal:///./node_modules/rxjs/_esm2015/Subscriber.js:87:13
next@webpack-internal:///./node_modules/rxjs/_esm2015/Subject.js:54:17
runNavigate/</<@webpack-internal:///./node_modules/@angular/router/esm2015/router.js:4678:40
ZoneDelegate.prototype.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:388:17
onInvoke@webpack-internal:///./node_modules/@angular/core/esm2015/core.js:4201:24
ZoneDelegate.prototype.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:387:17
Zone.prototype.run@webpack-internal:///./node_modules/zone.js/dist/zone.js:138:24
scheduleResolveOrReject/<@webpack-internal:///./node_modules/zone.js/dist/zone.js:858:52
ZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:421:17
onInvokeTask@webpack-internal:///./node_modules/@angular/core/esm2015/core.js:4192:24
ZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:420:17
Zone.prototype.runTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:188:28
drainMicroTaskQueue@webpack-internal:///./node_modules/zone.js/dist/zone.js:595:25
"
resolvePromisewebpack-internal:///./node_modules/zone.js/dist/zone.js:809:31scheduleResolveOrRejectwebpack-internal:///./node_modules/zone.js/dist/zone.js:861:17invokeTaskwebpack-internal:///./node_modules/zone.js/dist/zone.js:421:17node_modulesangular/core/esm2015/core.js:4192:24invokeTaskwebpack-internal:///./node_modules/zone.js/dist/zone.js:420:17runTaskwebpack-internal:///./node_modules/zone.js/dist/zone.js:188:28drainMicroTaskQueuewebpack-internal:///./node_modules/zone.js/dist/zone.js:595:25
Mihai Banu
  • 7
  • 1
  • 4

2 Answers2

0

a bit of context as to when this error occurs would be helpful, is it occurring when you click a button an anchor or when changing routes e.t.c...

zeezor
  • 51
  • 5
  • everytime the app is loaded the first time in the browser. if I refresh the page, the error dissapears. I've actually found what is causing it but can't understand why this is happening. The issue is that I have an app-header component that makes use of some data in a json using subscribe. `this.headerConfigService.getNavItems().subscribe(data => { this.subNavItems = data; }` – Mihai Banu May 15 '18 at 08:02
  • removing this line of code or refreshing the app after the initial loading, gets rid of the error. getNavItems() returns: `return this.http.get('app/common/appConfig/navigation-tabs.json')`, json exists, and all is good. – Mihai Banu May 15 '18 at 08:05
  • have you considered checking for when objects are null and hence not using them until they have been initialized to not null values? – zeezor May 15 '18 at 09:19
  • yeah, the issue is not with the objects in the json. It's something to do with the subscribe function. – Mihai Banu May 15 '18 at 09:55
0

The issue was that the user was not logged in and subscribing to get the JSON file was failing. There was a security constraint preventing to retrieve that data until the user logged in.

Once the user would log in the error would dissapear.

Mihai Banu
  • 7
  • 1
  • 4