TraceKit icon indicating copy to clipboard operation
TraceKit copied to clipboard

Add support for Node stack traces.

Open Leftium opened this issue 11 months ago • 1 comments

Was hoping to use TraceKit to get normalized stack traces across browsers and node.js.

  • Just using TraceKit.computeStackTrace(new Error()); no wish to subscribe or anything.
  • Unfortunately TraceKit doesn't seem to support node.js stack traces.

stacktrace-js supports node.js stack traces, but is no longer actively maintained:

  • https://github.com/stacktracejs/error-stack-parser/blob/9f33c224b5d7b607755eb277f9d51fcdb7287e24/error-stack-parser.js#L22-L37

Works in browser:

Image

Doesn't work in Node: (isometric JS that runs in both browser and server)

Image

Leftium avatar Feb 02 '25 02:02 Leftium

I use stack-trace for node stack trace parsing for one of my projects https://github.com/exceptionless/Exceptionless.JavaScript/tree/main/packages/node

If you wish to create a pr with test suite I'd be willing to accept it.

niemyjski avatar Feb 03 '25 11:02 niemyjski