Skip to content

feat(nextjs): Experimental support for thirdPartyErrorFilterIntegration on Turbopack - #19542

Merged
chargome merged 13 commits into
developfrom
cg/turbo-thirdparty
Feb 27, 2026
Merged

feat(nextjs): Experimental support for thirdPartyErrorFilterIntegration on Turbopack#19542
chargome merged 13 commits into
developfrom
cg/turbo-thirdparty

Conversation

@chargome

Copy link
Copy Markdown
Member

When Next.js switched to Turbopack as the default dev bundler, thirdPartyErrorFilterIntegration stopped working because it relies on @sentry/webpack-plugin injecting _sentryModuleMetadata into every app module — and Turbopack doesn't support webpack plugins.

This PR adds a new Turbopack loader (moduleMetadataInjectionLoader) that injects the same _sentryModuleMetadata snippet the webpack plugin would, using Turbopack's condition: { not: 'foreign' } to restrict injection to first-party code only. This is gated behind
_experimental.turbopackApplicationKey and requires Next.js 16+.

closes#19320

@chargomechargome self-assigned this Feb 26, 2026
@github-actions

github-actionsBot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser25.62 kB--
@sentry/browser - with treeshaking flags24.12 kB--
@sentry/browser (incl. Tracing)42.42 kB--
@sentry/browser (incl. Tracing, Profiling)47.09 kB--
@sentry/browser (incl. Tracing, Replay)81.24 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags70.86 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)85.94 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)98.2 kB--
@sentry/browser (incl. Feedback)42.43 kB--
@sentry/browser (incl. sendFeedback)30.29 kB--
@sentry/browser (incl. FeedbackAsync)35.34 kB--
@sentry/browser (incl. Metrics)26.79 kB--
@sentry/browser (incl. Logs)26.93 kB--
@sentry/browser (incl. Metrics & Logs)27.61 kB--
@sentry/react27.37 kB--
@sentry/react (incl. Tracing)44.76 kB--
@sentry/vue30.07 kB--
@sentry/vue (incl. Tracing)44.29 kB--
@sentry/svelte25.64 kB--
CDN Bundle28.16 kB--
CDN Bundle (incl. Tracing)43.25 kB--
CDN Bundle (incl. Logs, Metrics)29 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)44.09 kB--
CDN Bundle (incl. Replay, Logs, Metrics)68.08 kB--
CDN Bundle (incl. Tracing, Replay)80.13 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)80.99 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)85.64 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)86.53 kB--
CDN Bundle - uncompressed82.34 kB--
CDN Bundle (incl. Tracing) - uncompressed128.06 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed85.18 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed130.89 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed208.84 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed244.94 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed247.76 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed257.85 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed260.66 kB--
@sentry/nextjs (client)47.17 kB--
@sentry/sveltekit (client)42.88 kB--
@sentry/node-core52.18 kB+0.02%+9 B 🔺
@sentry/node174.48 kB+0.01%+4 B 🔺
@sentry/node - without tracing97.33 kB+0.01%+8 B 🔺
@sentry/aws-serverless113.13 kB+0.01%+8 B 🔺

View base workflow run

@logaretmlogaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice one!

@chargome
chargome merged commit 5b0c6bd into developFeb 27, 2026
71 checks passed
@chargome
chargome deleted the cg/turbo-thirdparty branch February 27, 2026 09:12
chargome added a commit to getsentry/sentry-docs that referenced this pull request Mar 13, 2026
Documents two new experimental Turbopack options for Next.js in
withSentryConfig:
- `_experimental.turbopackReactComponentAnnotation` —
[getsentry/sentry-javascript#19604](getsentry/sentry-javascript#19604)
- `_experimental.turbopackApplicationKey` —
[getsentry/sentry-javascript#19542](getsentry/sentry-javascript#19542)
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.

Next.js + Turbopack: thirdPartyErrorFilterIntegration (applicationKey)

2 participants

@chargome@logaretm