angular - 如何在 Firefox 中正确调试 Angular - 错误:“[object Object]”
问题描述
有什么方法可以启用与 Google Chrome 开箱即用的调试 Angular 应用程序相同级别的调试,尤其是避免出现以下错误:
Error: "[object Object]"
我正在使用FF 68.0b2 (64-bit - dev edition)。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();
}
解决方案
我认为 Angular 有问题defaultErrorLogger(console)
所以我收到这里描述的错误消息 https://stackoverflow.com/a/56440176/6190470
推荐阅读
- javascript - 开方括号数组
- pandas - 如何使用 map 和 lambda 函数将 pandas 中的列转换为日期时间?
- reactjs - 根据服务器数据反应渲染组件
- visual-studio - SSMS 扩展安装期间出现问题
- wpf - 如果我有来自 LiveCharts 的图表,我无法将元素添加到我的 GUI
- jsf - JSF Bean 在特定方法调用后不运行代码
- java - REST 如何在没有完整实体的情况下发布或放置(@RequestBody)
- python - pymysql - TypeError:字符串格式化期间并非所有参数都转换
- python-3.x - 有没有办法通过在该行的值中提供特定列来访问数据框的任何行?
- julia - 数组中存在的过滤器元素