diff --git a/peachjam/js/peachjam.ts b/peachjam/js/peachjam.ts index f0381cd9c..0094d7b0d 100644 --- a/peachjam/js/peachjam.ts +++ b/peachjam/js/peachjam.ts @@ -142,13 +142,18 @@ class PeachJam { } const frames = event.exception.values[0].stacktrace.frames; - // if all frames are anonymous, don't send this event + + // if first frame is anonymous, don't send this event // see https://github.com/getsentry/sentry-javascript/issues/3147 - if (frames && frames.length > 0 && frames.every((f: any) => f.filename === '')) { - return null; + if (frames && frames.length > 0) { + const firstFrame = frames[0]; + if (!firstFrame.filename || firstFrame.filename === '') { + return null; + } } } catch (e) { // ignore error, send event + console.log(e); } return event;