Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

256
Vistas
How do I get Node to break on a stack overflow?

Let's say I have a JS script like the following:

function recurse() {
    return recurse();
}
recurse();

If I run node recurse.js, it will of course fail with a "Maximum call stack size exceeded" error.

How do I get a debugger (for example, running in VS Code) to break before this exception happens, so I can see what's in the stack? I can attach a breakpoint, but it would take forever to hit this exception.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Maximum call stack size exceeded is an exception like any other. Wrap the call in a try/catch, and add a stop point inside the catch block, like so:

function recurse() {
    return recurse()
}

try {
  recurse()
} catch(e) {
  console.log(e) // <- stop here
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda