Closed
Description
For some reason on node side I managed to get following type of stack trace:
Error: Could not do something
at [object Object].foo.bar (foo.js:1:2)
Which gets parsed into
[{
fileName: 'Object].foo.bar (foo.js',
lineNumber: 1,
functionName: '[object',
typeName: 'Object',
methodName: null,
columnNumber: 2,
native: false
}]Problem seems to be with the regexp on this line:
https://github.com/felixge/node-stack-trace/blob/master/lib/stack-trace.js#L42
Might need to do some more advanced regexp magic, or just parse the line differently.. any thoughts?
Metadata
Metadata
Assignees
Labels
No labels
Activity
niemyjski commentedon Apr 24, 2026
Hi @jylauril 👋
Thanks for the detailed report and analysis. You're right — the regex breaks when the function name contains
[object Object]because the brackets and spaces confuse the capture groups.This is a legitimate parsing bug. A PR to fix the regex to handle bracketed function names would be very welcome!
fix: address PR #66 review, fix #29, verify #13 and #25
fix: address PR #66 review, fix #29, verify #13 and #25
fix: address PR #66/#67 review, fix #29, verify #13 and #25
Address PR #66 review comments, verify and close issues #13, #25 (#67)