我有一个 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/