Closed amakhrov closed 1 year ago
Hey, thanks for writing in. I agree the tracekit logic should be improved here, and we welcome PRs to address this!
@AbhiPrasad After more digging I realize that the particular issue I'm observing is specific to Angular (which appends zone name to every stacktrace line). This generally breaks the regex (gecko
variable in tracekit.ts
).
So even if the logical error (accessing undefinedstack[0].column
) is fixed, preventing the runtime error, the stacktrace will still not be parsed correctly overall.
Probably the right answer is making the regex more permissive - but it can potentially introduce regressions (if there are cases not covered by existing unit tests)
In our project we ended up disable zone-error
plugin, so the zone name is no longer added to stack traces, and the problem reported above is no longer reproduced.
I don't know any other way to activate the branch of code with the error - or is it even possible in current versions of Firefox (looks like the code was authored quite long ago).
Closing this, seems to be a weird edge case and probably no longer relevant.
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
current
master
branch, the same for last 2 yearsDescription
https://github.com/getsentry/sentry-javascript/blob/a6f8dc26a4c7ae2146ae64995a2018c8578896a6/packages/browser/src/tracekit.ts#L148-L154
This has special handling for firefox It
if
condition isi === 0
. it means it's the very first iteration of the loop, and no frames have been pushed to thestack
array. However, below the code tries to access it (stack[0].column
), which throws an exception, gets caught higher in the call stack and results in silently dropping the event