Skip to content

fix(browser): Fix internal frame detection in minified bundles - #20802

Merged
chargome merged 3 commits into
developfrom
cg/third-p-minified
May 12, 2026
Merged

fix(browser): Fix internal frame detection in minified bundles#20802
chargome merged 3 commits into
developfrom
cg/third-p-minified

Conversation

@chargome

Copy link
Copy Markdown
Member

The ignoreSentryInternalFrames option in thirdPartyErrorFilterIntegration relied on source-code-level signals (filename, context_line, comment patterns) that are all lost after minification.

This PR adds a runtime depth counter (GLOBAL_OBJ._sentryWrappedDepth) that tracks whether processEvent is running inside a sentryWrapped call. This works regardless of minification and also covers framework-caught errors (e.g. Vue swallowing the error before sentryWrapped's catch fires).

closes#20687

@chargomechargome self-assigned this May 11, 2026
@github-actions

github-actionsBot commented May 11, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser26.87 kB+0.08%+21 B 🔺
@sentry/browser - with treeshaking flags25.3 kB+0.1%+24 B 🔺
@sentry/browser (incl. Tracing)44.77 kB+0.08%+32 B 🔺
@sentry/browser (incl. Tracing + Span Streaming)46.75 kB+0.05%+22 B 🔺
@sentry/browser (incl. Tracing, Profiling)49.78 kB+0.07%+31 B 🔺
@sentry/browser (incl. Tracing, Replay)84.4 kB+0.04%+26 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags73.83 kB+0.03%+16 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)89.1 kB+0.03%+24 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)101.74 kB+0.03%+24 B 🔺
@sentry/browser (incl. Feedback)44.05 kB+0.06%+23 B 🔺
@sentry/browser (incl. sendFeedback)31.68 kB+0.08%+24 B 🔺
@sentry/browser (incl. FeedbackAsync)36.79 kB+0.06%+22 B 🔺
@sentry/browser (incl. Metrics)27.95 kB+0.09%+25 B 🔺
@sentry/browser (incl. Logs)28.1 kB+0.08%+21 B 🔺
@sentry/browser (incl. Metrics & Logs)28.78 kB+0.09%+24 B 🔺
@sentry/react28.62 kB+0.12%+32 B 🔺
@sentry/react (incl. Tracing)47.03 kB+0.06%+25 B 🔺
@sentry/vue31.79 kB+0.12%+36 B 🔺
@sentry/vue (incl. Tracing)46.64 kB+0.11%+47 B 🔺
@sentry/svelte26.89 kB+0.08%+20 B 🔺
CDN Bundle29.25 kB+0.05%+12 B 🔺
CDN Bundle (incl. Tracing)47.17 kB+0.04%+16 B 🔺
CDN Bundle (incl. Logs, Metrics)30.62 kB+0.05%+14 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics)48.29 kB+0.03%+13 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)69.96 kB+0.03%+20 B 🔺
CDN Bundle (incl. Tracing, Replay)84.56 kB+0.02%+10 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)85.64 kB+0.02%+13 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)90.38 kB+0.02%+16 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)91.48 kB+0.02%+17 B 🔺
CDN Bundle - uncompressed86.03 kB+0.05%+42 B 🔺
CDN Bundle (incl. Tracing) - uncompressed141.51 kB+0.03%+42 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed90.22 kB+0.05%+42 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed144.97 kB+0.03%+42 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed215.05 kB+0.02%+42 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed260.22 kB+0.02%+42 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed263.66 kB+0.02%+42 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed273.92 kB+0.02%+42 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed277.35 kB+0.02%+42 B 🔺
@sentry/nextjs (client)49.55 kB+0.06%+25 B 🔺
@sentry/sveltekit (client)45.26 kB+0.06%+25 B 🔺
@sentry/node-core60.84 kB+0.02%+10 B 🔺
@sentry/node165.98 kB+0.01%+9 B 🔺
@sentry/node - without tracing73.96 kB+0.01%+5 B 🔺
@sentry/aws-serverless108.07 kB+0.01%+5 B 🔺
@sentry/cloudflare (withSentry) - minified170.66 kB--
@sentry/cloudflare (withSentry)430.47 kB--

View base workflow run

@chargome
chargome marked this pull request as ready for review May 11, 2026 13:14
@chargome
chargome requested a review from a team as a code ownerMay 11, 2026 13:14
Comment threadpackages/browser/src/helpers.ts
Comment threadpackages/core/src/integrations/third-party-errors-filter.ts Outdated

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1ae6a53. Configure here.

Comment threadpackages/core/src/integrations/third-party-errors-filter.ts
Comment threadpackages/core/src/integrations/third-party-errors-filter.ts
Comment threadpackages/core/src/integrations/third-party-errors-filter.ts
@chargome
chargome requested a review from logaretmMay 12, 2026 09:16
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ignoreSentryInternalFrames in thirdPartyErrorFilterIntegration doesn't work when minification enabled

2 participants

@chargome@logaretm