Repository navigation
fix(cli): Accept glob patterns as the sourcemap upload target - #1934
Merged
Merged
Conversation
Bundler plugins pass sourcemaps.assets straight to `sourcemap upload`, and that option is documented as a glob. A target like '.next/static/**' failed with "Directory '.next/static/**' does not exist." (CLI-1FN). Walk the glob's static base and keep the pairs whose JS or map file the rest of the pattern matches. An existing directory is still used as-is, so names like '[locale]' keep working. Co-Authored-By: Miguel Betegon <miguel.betegon@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c8d0427. Configure here.
A glob whose wildcard comes before a dot segment, like '**/.next/**', could never match: its base is '.', and the walk skipped hidden directories before the glob saw them. Walk them for glob targets and let the glob decide, so dot segments match only when the pattern names them, the same as the glob package the bundler plugins use.
BYK
approved these changes
Nov 4, 2026
7 tasks done
This branch was previously deployed
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.

Part of CLI-1FN. About 1 in 8 sampled events is
Directory '…' does not exist., and half of those are globs:.next/static/**,.next/**/*.js,**/*.js. They come from@sentry/bundler-plugins(via@sentry/nextjs) direct-upload mode, which passes the user'ssourcemaps.assetsstraight tosourcemap uploadas the directory. That option is documented as a glob, so the upload fails on every build.sourcemap uploadnow accepts a glob. It walks the glob's static base and keeps a pair when the rest of the pattern matches its JS file or its.mapfile. A path that exists as a directory is still used as-is, so Next.js names likeapp/[locale]keep working.Before
After
(This is a real Next.js 16 build uploaded to a local mock of the chunk-upload API.)
A missing base still gets a clear error, now naming the base directory:
Directory '.next/static' does not exist.@sentry/bundler-pluginspinssentry@^0.45.0, which on 0.x semver means<0.46.0. Plugin users get this fix only after that range is bumped.via bete.
--
View Session [Sentry]