Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 - EXCEPTION: TypeError: Cannot read property 'isSkipSelf' of null browser_adapter.ts [closed]

Tags:

angular

all ! After update from beta 12 to RC1, I'm facing this issue - and I've no clue what's going on. Does anyone have the solution ?

EXCEPTION: TypeError: Cannot read property 'isSkipSelf' of null browser_adapter.ts:88 EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'isSkipSelf' of null browser_adapter.ts:78 EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'isSkipSelf' of nullBrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117onError @ ng_zone.ts:138onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426 browser_adapter.ts:78 STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:56(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117onError @ ng_zone.ts:138onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426 browser_adapter.ts:78 Error: Uncaught (in promise): TypeError: Cannot read property 'isSkipSelf' of null at resolvePromise (zone.js:538) at PromiseCompleter.reject (zone.js:515) at eval (application_ref.ts:340) at ZoneDelegate.invoke (zone.js:323) at Object.onInvoke (ng_zone_impl.ts:67) at ZoneDelegate.invoke (zone.js:322) at Zone.run (zone.js:216) at zone.js:571 at ZoneDelegate.invokeTask (zone.js:356) at Object.onInvokeTask (ng_zone_impl.ts:56)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:57(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117onError @ ng_zone.ts:138onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426 zone.js:461 Unhandled Promise rejection: Cannot read property 'isSkipSelf' of null ; Zone: angular ; Task: Promise.then ; Value: TypeError: Cannot read property 'isSkipSelf' of null(…)consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426 zone.js:463 Error: Uncaught (in promise): TypeError: Cannot read property 'isSkipSelf' of null(…)

like image 448
Marco Jr Avatar asked May 11 '16 14:05

Marco Jr


3 Answers

Looks like this issue https://github.com/angular/angular/issues/8519

  • maybe you need to update the parameter list of the transform() function of a pipe
  • you might miss the emitDecoratorMetadata: true in your config
  • have a circular dependency that is not resolved using forwardRef()
  • some import that doesn't resolve
  • missing @Injectable() on a service
  • ...
like image 130
Günter Zöchbauer Avatar answered Nov 15 '22 15:11

Günter Zöchbauer


For me, taking out the localStorage from providers: from providers: [HTTP_PROVIDERS, localStorage] to providers: [HTTP_PROVIDERS]

fixed the issue. I am almost certain I witnessed it working with localStorage bug maybe it was a mirage.

Just make sure that you don't confuse directives: with providers:

like image 1
foxjazzHack Avatar answered Nov 15 '22 15:11

foxjazzHack


This issue has also been reported in: https://github.com/angular/angular/issues/8704

If you have the following situation:

component A depends on service B which depends on service C,

the solution is to add @Injectable() to service B and also add services B and C to the providers list of component A.

(An alternative solution is to add a forwardRef to service C in the constructor of service B, using @Inject(forwardRef(() => ServiceC) and also add services B and C to the providers list of component A)

like image 1
Hans Beemsterboer Avatar answered Nov 15 '22 13:11

Hans Beemsterboer