gpt4 book ai didi

angular - 如何在 Firefox 中正确调试 Angular - 错误 : "[object Object]"

转载 作者:行者123 更新时间:2023-12-02 14:56:50 24 4
gpt4 key购买 nike

是否有任何方法可以启用 Google Chrome 为调试 Angular 应用程序提供的相同级别的调试,特别是避免此类错误:

Error: "[object Object]"

我使用的是FF 68.0b2(64 位 - 开发版)。 Chrome 中的相同错误是人类可读的:

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......

我目前使用的是 Angular v7.2.15。

[编辑]

代码示例

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

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

}

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

引用:http://codedam.com/angular-error-error-object-object/

最佳答案

我认为 Angular 存在问题 defaultErrorLogger(console)所以我收到如下所述的错误消息 https://stackoverflow.com/a/56440176/6190470

关于angular - 如何在 Firefox 中正确调试 Angular - 错误 : "[object Object]",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56234393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com