Maximum call stack size exceeded error

后端 未结 30 2572
独厮守ぢ
独厮守ぢ 2020-11-21 23:51

I am using a Direct Web Remoting (DWR) JavaScript library file and am getting an error only in Safari (desktop and iPad)

It says

Maximum call

30条回答
  •  死守一世寂寞
    2020-11-22 00:24

    The problem with detecting stackoverflows is sometimes the stack trace will unwind and you won't be able to see what's actually going on.

    I've found some of Chrome's newer debugging tools useful for this.

    Hit the Performance tab, make sure Javascript samples are enabled and you'll get something like this.

    It's pretty obvious where the overflow is here! If you click on extendObject you'll be able to actually see the exact line number in the code.

    You can also see timings which may or may not be helpful or a red herring.


    Another useful trick if you can't actually find the problem is to put lots of console.log statements where you think the problem is. The previous step above can help you with this.

    In Chrome if you repeatedly output identical data it will display it like this showing where the problem is more clearly. In this instance the stack hit 7152 frames before it finally crashed:

提交回复
热议问题