How to increase number of Call Stack entries in Google Chrome Developer Tools (or Firefox)?

20,327

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"
Share:
20,327

Related videos on Youtube

Tony_Henrich
Author by

Tony_Henrich

Updated on April 22, 2020

Comments

  • Tony_Henrich
    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
      dontGoPlastic about 12 years
      If you put a breakpoint in the earliest call, can you see what came before it?
    • abergmeier
      abergmeier almost 12 years
      For testing you can try to up the js stack size: code.google.com/p/v8/issues/detail?id=1631
  • abergmeier
    abergmeier almost 12 years
    You 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
    Jeremy Moritz almost 10 years
    Can 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
    JasonS almost 10 years
    if 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
    JasonS almost 10 years
    such as Error.stackTraceLimit=50
  • NoNameProvided
    NoNameProvided almost 8 years
    Setting the Error.stackTraceLim‌​it doesn't work anymore.
  • André Werlang
    André Werlang almost 8 years
    @NoNameProvided set to Infinity instead.
  • darksoulsong
    darksoulsong over 7 years
    On 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
    gr3g over 7 years
    Isn'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
    Ashish Singh almost 7 years
    Setting the Error.stackTraceLim‌​it property works on Chrome 60. Running on Ubuntu.
  • Devin Rhode
    Devin Rhode over 6 years
    Setting it to 50 worked for me today in Chrome 62.0.3202.94 (Official Build) (Mac OS El Capitan 64-bit)