Repository navigation
fix(bundler-plugins): Keep uploading when a directory has no source maps - #26092
Merged
Merged
Conversation
The new CLI fails a directory with no JS + source map pairs. The adapter uploads directories one by one, so the first empty one (.next/server for Next.js apps without server source maps) aborted the rest, and client source maps were never uploaded. Pass allowEmpty and warn per directory. Co-Authored-By: Miguel Betegon <miguel.betegon@sentry.io>
Contributor
size-limit report 📦Compared: 16458df (PR test merge using develop at 619b3aa) Against: b31ae89 (develop) · base run #65576
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 6 not successful, 40 successful. See the run.
Successful checks
|
…s-skip-empty-sourcemap-dirs Co-Authored-By: bete <28983162+betegon@users.noreply.github.com>
betegon
marked this pull request as ready for review
November 10, 2026 15:45
betegon
requested review from
Lms24,
andreiborza,
chargome,
msonnb and
s1gr1d
and removed request for
a team
November 10, 2026 15:45
JPeer264
reviewed
Nov 10, 2026
List every directory without source maps in a single warning instead of repeating the same message for each one.
JPeer264
approved these changes
Nov 10, 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.
Why: The new
sentryCLI throws aValidationErrorfor any directory that has no JS + source map pairs.SentryCliAdapter.uploadSourcemapsuploads directories one at a time, so the first empty directory stops the whole loop.@sentry/nextjsuploads.next/serverfirst, so if server source maps are off, the client chunks that do have maps never get uploaded. The plugin only logs the error and the build passes, so this goes unnoticed. CLI 0.48+ stops reporting this error to Sentry, but it still throws, so the upload still stops without this change.The CLI check stays strict on purpose, because it catches build misconfiguration. The adapter now passes
allowEmpty: true, collects the directories that uploaded 0 files, and logs a warning for each. In direct-upload mode, "Successfully uploaded" is logged only if at least one directory actually uploaded something. The staged-upload path already returns early with a warning when no artifact has a source map, so it is unchanged.Before:
After:
How to review: Start with
src/core/cli.ts, then the two call sites inbuild-plugin-manager.ts.cli-contract.test.tsruns the real CLI (nowsentry@^0.49.0after #26200) against the mock server with one empty directory followed by one real directory.Unsure about: A directory that does not exist still throws and stops the loop;
allowEmptyonly covers existing directories without source maps. I left that case out of this PR.via bete, @betegon.
--
View Session in Sentry