angular - 如何调试 "Maximum call stack size exceeded"等错误

标签 angular debugging ionic-framework

我有一个 ionic /Angular 项目,我暂停了一段时间。我继续处理它,但控制台中出现错误。用户效果是,10-15 秒内没有任何显示,然后我的 google 已加载,但随后我没有看到任何故障。

core.js:4197 ERROR RangeError: Maximum call stack size exceeded
    at MapSubscriber._error (Subscriber.js:75)
    at MapSubscriber.error (Subscriber.js:55)
    at MergeMapSubscriber.notifyError (OuterSubscriber.js:7)
    at InnerSubscriber._error (InnerSubscriber.js:14)
    at InnerSubscriber.error (Subscriber.js:55)
    at CatchSubscriber._error (Subscriber.js:75)
    at CatchSubscriber.error (Subscriber.js:55)
    at CatchSubscriber.error (catchError.js:32)
    at MergeMapSubscriber.notifyError (OuterSubscriber.js:7)
    at InnerSubscriber._error (InnerSubscriber.js:14)

我搜索了一下,我已经从 Angular 10 更新到 Angular 11,更新了所有库,在 stackoverflow 上找到了很多答案,包括这个 Angular 7 error RangeError: Maximum call stack size exceeded

但我不知道哪个区域会导致问题。

我尝试对我所在页面的 ngOnInit/constructor 上的所有内容进行注释,但没有成功。

我怎样才能找到此类错误的根本原因?我真的很迷茫,我不知道该怎么办,这只会让我的应用程序卡住 10-15 秒然后崩溃。

在此之后我遇到了 Firebase 超时,但我猜这是因为 Angular 太忙于处理这个调用堆栈问题。

最佳答案

这不是一个普遍的答案,但我希望它能给出一些例子:

就我而言,我从模块 B 引用模块 A,从模块 A 引用模块 B,因此这种循环引用导致堆栈溢出,从而产生此结果。

关于angular - 如何调试 "Maximum call stack size exceeded"等错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65562159/

相关文章:

javascript - 如何在 Typescript 中正确导入 MomentJS 解决以下错误 : "Type ' typeof moment' has no compatible call signatures.》

excel - 通过循环调试

c++ - 如何调试段错误

node.js - 如何在 VS Code 中调试 vue js 应用程序?

ios - 为什么在 iOS 上运行的空白 ionic 电容器 App 返回此错误 : Could not connect to the server

javascript - 为什么 float 权利不起作用也很重要?

css - ionic 3元素中的 Font Awesome 安装

Angular2从错误中提取json

angularjs - 如何识别使用哪个版本的 Angular (1,2 或 4)?

javascript - ionic 2 : "Property ' number' does not exist on type 'typeof"