3

Is there any way to enable the same level of debugging that Google Chrome gives out of the box for debugging Angular applications and in particular to avoid errors like that:

Error: "[object Object]"

I'm using FF 68.0b2 (64-bit - dev edition). The same error in Chrome is human readable:

core.js:15724 
ERROR Error: Uncaught (in promise): TypeError: 
Cannot read property 'unsubscribe' of undefined
TypeError: Cannot read property 'unsubscribe' of undefined
    at ProfileComponent.push......

I'm currently using Angular v7.2.15.

[EDIT]

Code Example

ngOnInit() {
  this.authSub = this.authService.isAuthenticated()
      .subscribe((authenticated: boolean) => {...}

  this.profileSub = this.userService.getCurrentUserProfile()
            .subscribe((me) => {...}

}

ngOnDestroy() {
  this.authSub.unsubscribe();
  this.profileSub.unsubscribe();
}

Reference: http://codedam.com/angular-error-error-object-object/

sentenza
  • 1,608
  • 3
  • 29
  • 51
  • Provide some code please @sentenza – Aarsh May 21 '19 at 08:43
  • Can you check if you are not console logging the `Error: "[object Object]"` in your code ? – ibenjelloun May 21 '19 at 08:48
  • @Aarsh I added the code example. @ibenjelloun I'm not logging to the console. It's an error that comes out from `core.js` itself. – sentenza May 21 '19 at 08:51
  • Possible duplicate of [Resolver Emitting Error \` ERROR Error: "\[object Object\]" \`](https://stackoverflow.com/questions/51041301/resolver-emitting-error-error-error-object-object) – manish kumar Jul 14 '19 at 11:09

1 Answers1

0

I think problem in Angular defaultErrorLogger(console) So I get error message as described here https://stackoverflow.com/a/56440176/6190470

kaminarifox
  • 413
  • 1
  • 5
  • 14