question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node: increase stack trace limit

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.13.2

Description

I noticed that my Node stack traces appear very short in Sentry, which makes errors hard to debug.

IIUC, raven-node used to set Error.stackTraceLimit = Infinity. https://github.com/getsentry/raven-node/blob/6dbb5ef37ccd536360d5f73b601a42faee23b2f4/index.js#L10

@sentry/browser still sets this, but @sentry/node does not. Is there a reason for that?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
OliverJAshcommented, Mar 5, 2020

Makes sense, thank you. It might be worth adding a note about this to the docs, as the default stack trace size is pretty useless IMO.

1reaction
kamilogorekcommented, Mar 5, 2020

We just didn’t want to enforce it, as this change can be applied by everyone manually.

Error.stackTraceLimit = 50;
Sentry.init({ ... });

This will work just fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

More than 10 lines in a node.js stack error?
You can pass stack trace limit as a command line param to node : ... You can increase the stack size with: node...
Read more >
Enhancing stack trace output | Node Cookbook - Third Edition
The --stack-trace-limit flag instructs the V8 JavaScript engine to retain more stacks on each tick (each time round) of the event loop. When...
Read more >
You can configure the logged error stack trace length in ...
For easier error debugging you can increase the stack trace limit in Chrome (V8) and Node.js.
Read more >
Show More Lines in a Node.js Error Stack Trace | egghead.io
... Nodejs displays only a handful of lines. In this lesson, you will learn how to increase the stack trace limit to show...
Read more >
Stack trace API - V8 JavaScript engine
All internal errors thrown in V8 capture a stack trace when they are created. This stack trace can be accessed from JavaScript through...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found