Skip to content

fix(nextjs): Apply silent to the SDK's own build logs - #23621

Merged
chargome merged 2 commits into
developfrom
chargome/fix/nextjs-honor-silent-build-option
Aug 26, 2026
Merged

fix(nextjs): Apply silent to the SDK's own build logs#23621
chargome merged 2 commits into
developfrom
chargome/fix/nextjs-honor-silent-build-option

Conversation

@chargome

Copy link
Copy Markdown
Member

Routes the SDK's own build-time output through a silent-aware logger, so silent: true suppresses it as documented.

  • Threads silent into the build helpers that log but didn't receive it, matching how debug is already passed
  • silent also suppresses the "could not inject SDK init" error, matching the bundler plugin's logger, which gates error on silent too
  • warnOnRemovedBuildOptions needed no core change — it already accepts a logWarning callback

Fixes #23620

…logs

`silent` was only forwarded to the bundler plugin, so every message the Next.js
SDK printed itself still reached the console despite the option being documented
as suppressing all Sentry SDK build logs.

Route those messages through a small `silent`-aware logger and thread the option
to the helpers that log but did not previously receive it. The removed-option
warning goes through the existing `logWarning` hook of `warnOnRemovedBuildOptions`,
so no core change is needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome chargome self-assigned this Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.6 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.51 kB - -
@sentry/browser (incl. Tracing, Replay) 88.04 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.44 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.75 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.44 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.79 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.82 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.07 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.95 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.98 kB - -
CDN Bundle (incl. Tracing, Replay) 86.56 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.25 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.69 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.38 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.36 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.12 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.79 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.48 kB - -
@sentry/nextjs (client) 53.33 kB - -
@sentry/sveltekit (client) 49.03 kB - -
@sentry/core/server 65.08 kB - -
@sentry/core/browser 52.38 kB - -
@sentry/node 121.51 kB +0.02% +23 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.19 kB - -
@sentry/node - without tracing 87.62 kB +0.03% +20 B 🔺
@sentry/aws-serverless 95.77 kB +0.03% +26 B 🔺
@sentry/cloudflare (withSentry) - minified 199.5 kB - -
@sentry/cloudflare (withSentry) 495.46 kB - -

View base workflow run

The loaders are their own rollup entry point built with `preserveModules`, so
emitted paths are relative to the module graph's common root. Importing the
shared build logger from `src/config` moved that root up one level and emitted
every loader into `config/loaders/loaders/`, so the `path.resolve(__dirname,
'loaders', ...)` lookups in `webpack.ts` no longer resolved and every Next.js
app failed to compile.

Check `silent` inline in the loader instead, and document the constraint so the
import is not reintroduced.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 666aa7f. Configure here.

@chargome
chargome marked this pull request as ready for review August 26, 2026 09:43
@chargome
chargome requested a review from a team as a code owner August 26, 2026 09:43
@chargome
chargome requested review from andreiborza, logaretm, mydea, nicohrubec and s1gr1d and removed request for a team and mydea August 26, 2026 09:43

@andreiborza andreiborza 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.

ja passt

@chargome
chargome merged commit 5ee1875 into develop Aug 26, 2026
142 of 145 checks passed
@chargome
chargome deleted the chargome/fix/nextjs-honor-silent-build-option branch August 26, 2026 09:51
Sign up for free to 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.

silent build option does not suppress the Next.js SDK's own build logs

3 participants