How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox)?
Solution 1
Chrome solution
https://v8.dev/docs/stack-trace-api
can set via commandline on startup --js-flags="--stack-trace-limit <value>"
or at runtime at loading a page: Error.stackTraceLimit=undefined //unlimited stack trace
Solution 2
In Chrome (also in node), you can type this in the js console:
Error.stackTraceLimit = Infinity;
Alternatively see this page for Chrome command line flags: https://v8.dev/docs/stack-trace-api (need to restart Chrome):
$ google-chrome --js-flags="--stack-trace-limit 10000"
Related videos on Youtube
Tony_Henrich
Updated on April 22, 2020Comments
-
Tony_Henrich about 4 years
How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox Firebug)? I am getting a Javascript error in a third party control's Javascript. All the calls in the Call Stack window do not belong to my own code. I want to know which line in my code triggered the sequence of events. The Call Stack is not large enough to display something from my own code.
-
dontGoPlastic about 12 yearsIf you put a breakpoint in the earliest call, can you see what came before it?
-
abergmeier almost 12 yearsFor testing you can try to up the js stack size: code.google.com/p/v8/issues/detail?id=1631
-
-
abergmeier almost 12 yearsYou are wrong. There is a maximum stack size and it is very important. Not for stuff written in an async way - but more e.g. for interpreters. I ran into this problem with Chrome (has a far smaller maximum stack size than Firefox has) when having a Lisp interpreter. Mostly in the end the best thing to do is to change your JavaScript so it runs asynchronously (and to slice the processing via
setTimeout
). That said - for a third party script I do not really have a good idea how to solve it. -
Jeremy Moritz almost 10 yearsCan you please show the full command? I tried
open -a Google\ Chrome --args --js-flags="--stack-trace-limit 50"
but the stack trace still stops at 10 -
JasonS almost 10 yearsif you open chrome dev console you can just type '''Error.stackTraceLimit''' and it will show you the current value. you can then modify it as you wish.
-
JasonS almost 10 yearssuch as
Error.stackTraceLimit=50
-
NoNameProvided almost 8 yearsSetting the
Error.stackTraceLimit
doesn't work anymore. -
André Werlang almost 8 years@NoNameProvided set to Infinity instead.
-
darksoulsong over 7 yearsOn Windows, where do I pass these parameters to Chrome? I mean, the "--js-flags" ones? Google Chrome is not a global variable that I can access from the command prompt. Do I need to add it to the path?
-
gr3g over 7 yearsIsn't it dangerous to be able to change this at runtime? I imagine an advertisement page blocking your laptop/phone because of an infinite loop
-
Ashish Singh almost 7 yearsSetting the
Error.stackTraceLimit
property works on Chrome 60. Running on Ubuntu. -
Devin Rhode over 6 yearsSetting it to 50 worked for me today in Chrome 62.0.3202.94 (Official Build) (Mac OS El Capitan 64-bit)