feat(nextjs): Align build options with BuildTimeOptionsBase - #23563
Merged
Conversation
Build `SentryBuildOptions` on the shared `BuildTimeOptionsBase` instead of redeclaring the option set by hand. Next.js was the last meta-framework SDK not using the shared type, which is why #23372 had to manually add `moduleMetadata` and `sourcemaps.resolveSourceMap`. Six options stay declared locally, each for a Next.js-specific reason: `project` accepts `string[]`, `sourcemaps` adds `deleteSourcemapsAfterUpload`, `release` omits `inject` because the SDK always sets it, and `buildTimeInstrumentation` / `applicationKey` / `moduleMetadata` document webpack-vs-Turbopack behavior differences. Inheriting the base type widens `sourcemaps.disable` to accept `'disable-upload'`. Next.js checked the option for truthiness where it controls source map generation, which would have suppressed generation entirely rather than just the upload, so those checks now compare against `true` and the auto-delete defaults skip `'disable-upload'`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ 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 9e5d200. Configure here.
`debug` is respected by the SDK's own build-time code in several places; only `silent` is still plugin-only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…y/sentry-javascript into feat/nextjs-align-build-options
…pload'` Treating `'disable-upload'` as "upload off, everything else on" made the SDK enable source map generation and then skip deletion, leaving `.next/static/**/*.map` served publicly. `'disable-upload'` means the SDK stays out of the source map pipeline entirely and only the bundler plugin's debug ID injection runs, matching `sentryTanstackStart.ts`. Generation is the user's call via `productionBrowserSourceMaps` / `devtool`, and the SDK only auto-deletes what it auto-generated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The base type's doc doesn't mention that this option overrides `deleteSourcemapsAfterUpload`, which is Next.js-only. Override it like `ignore` so the precedence stays documented. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The type test needs vitest typecheck enabled, and this package's `tsconfig.test.json` has never been run - it currently has ~80 errors in unrelated test files. Cleaning those up and adding the type test belongs in its own PR rather than riding along with a type refactor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chargome
marked this pull request as ready for review
August 25, 2026 12:46
chargome
requested review from
logaretm,
mydea,
nicohrubec and
s1gr1d
and removed request for
a team and
mydea
August 25, 2026 12:46
s1gr1d
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds
SentryBuildOptionson the sharedBuildTimeOptionsBaseinstead of redeclaring it by hand — follow-up to #23372.project(allowsstring[],projectoption type should bestring | string[]across all framework SDKs #21069),sourcemaps(Next-onlydeleteSourcemapsAfterUpload),release(injectis SDK-controlled), andbuildTimeInstrumentation/applicationKey/moduleMetadata(Turbopack caveats in their docs).sourcemaps.disablegains'disable-upload'andrelease.setCommits/deploygainfalse, both passed through to the bundler plugin — no behavior change.'disable-upload'doesn't make the SDK auto-generate source maps it would neither upload nor delete.