Skip to content

fix(nextjs): Skip build modification when SRI is enabled - #20694

Merged
chargome merged 1 commit into
developfrom
feat/fix-sri-turbopack
May 6, 2026
Merged

fix(nextjs): Skip build modification when SRI is enabled#20694
chargome merged 1 commit into
developfrom
feat/fix-sri-turbopack

Conversation

@chargome

Copy link
Copy Markdown
Member

With this we detect ant SRI config and, if enabled, skip the logic for stripping sourcemap comments on finished builds.

closes#20675

@chargomechargome self-assigned this May 6, 2026
@chargomechargome changed the title feat(nextjs): Skip build modification when SRI is enabledfix(nextjs): Skip build modification when SRI is enabledMay 6, 2026
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser26.3 kB--
@sentry/browser - with treeshaking flags24.78 kB--
@sentry/browser (incl. Tracing)44.17 kB--
@sentry/browser (incl. Tracing + Span Streaming)46.39 kB--
@sentry/browser (incl. Tracing, Profiling)49.14 kB--
@sentry/browser (incl. Tracing, Replay)83.55 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags73.01 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)88.23 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)100.84 kB--
@sentry/browser (incl. Feedback)43.44 kB--
@sentry/browser (incl. sendFeedback)31.11 kB--
@sentry/browser (incl. FeedbackAsync)36.19 kB--
@sentry/browser (incl. Metrics)27.6 kB--
@sentry/browser (incl. Logs)27.73 kB--
@sentry/browser (incl. Metrics & Logs)28.43 kB--
@sentry/react28.04 kB--
@sentry/react (incl. Tracing)46.4 kB--
@sentry/vue31.18 kB--
@sentry/vue (incl. Tracing)46.02 kB--
@sentry/svelte26.32 kB--
CDN Bundle28.91 kB--
CDN Bundle (incl. Tracing)46.94 kB--
CDN Bundle (incl. Logs, Metrics)30.34 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)48.04 kB--
CDN Bundle (incl. Replay, Logs, Metrics)69.4 kB--
CDN Bundle (incl. Tracing, Replay)84.07 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)85.15 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)89.89 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)90.97 kB--
CDN Bundle - uncompressed84.88 kB--
CDN Bundle (incl. Tracing) - uncompressed140.44 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed89.08 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed143.9 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed212.99 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed258.24 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed261.69 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed271.94 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed275.38 kB--
@sentry/nextjs (client)48.9 kB--
@sentry/sveltekit (client)44.64 kB--
@sentry/node-core59.81 kB+0.02%+10 B 🔺
@sentry/node163.43 kB+0.01%+8 B 🔺
@sentry/node - without tracing72.28 kB+0.02%+8 B 🔺
@sentry/aws-serverless106.95 kB+0.01%+7 B 🔺
@sentry/cloudflare (withSentry) - minified168.38 kB--
@sentry/cloudflare (withSentry)424.9 kB--

View base workflow run

@chargome
chargome marked this pull request as ready for review May 6, 2026 08:48
@chargome
chargome requested a review from a team as a code ownerMay 6, 2026 08:48
@chargome
chargome requested a review from logaretmMay 6, 2026 08:49
@masterjanic

Copy link
Copy Markdown

@chargome As far as I understand this will just skip the stripping so the not existing source map urls will still take place in production builds. Will there be any further solution? I guess the stripping would need to be done before Next.js / Turbopack generates the hashes. Otherwise we still get the sourcemap 404 warnings in the browser when SRI is enabled.

@chargome

Copy link
Copy Markdown
MemberAuthor

@masterjanic debug id injections and source map handling in turbopack already is baked into the build phase in next.js, not coming from sentry. While I agree this is sort of a tradeoff, the 404s for certain .map files in the dev console are harmless and will not interfere with your app in any way. We should investigate with vercel if we can avoid the sourceMappingURL comments in the first place - but this pr unblocks SRI for now

@nicohrubecnicohrubec 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

@chargome
chargome merged commit 12cd3e5 into developMay 6, 2026
77 checks passed
@chargome
chargome deleted the feat/fix-sri-turbopack branch May 6, 2026 11:46
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.

Subresource Integrity (SRI) not working on Next.js with Turbopack

3 participants

@chargome@masterjanic@nicohrubec