我正在使用直接Web Remoting (DWR) JavaScript库文件,只在Safari(桌面和iPad)中得到一个错误

它说

超过最大调用堆栈大小。

这个错误到底是什么意思,它是否完全停止处理?

Safari浏览器也有任何修复(实际上是在iPad Safari上,它说

JS:执行超时

我认为这是相同的调用堆栈问题)


当前回答

在我的例子中,在app。module中。ts,我得到这个错误,因为我在imports和entryComponents中声明了组件。

Example:

import { MyComponent } from '....';

@NgModule({
  declarations: [
    MyComponent 
  ],
  imports: [
    MyComponent  -- > remove this from here!!!!
  ],
  providers: [],
  bootstrap: [AppComponent],
  entryComponents: [MyComponent]
})
export class AppModule { }

其他回答

对我来说 我错误地分配了相同的变量名,并给val函数“class_routine_id”

var class_routine_id = $("#class_routine_id").val(class_routine_id);

应该是这样的:

 var class_routine_id = $("#class_routine_id").val(); 

检查Chrome dev工具栏控制台中的错误细节,这将为您提供调用堆栈中的函数,并指导您找到导致错误的递归。

如果您不小心导入/嵌入了相同的JavaScript文件两次,有时会出现这种情况,值得在检查器的资源选项卡中检查。

我试图给一个变量赋值,一个没有声明的变量。

声明变量修正了我的错误。

在我的例子中,我有两个同名的变量!