feat: support React Native sourcemaps in sourcemaps upload#735
Merged
Conversation
The `sourcemaps upload` command only discovered web bundles (`.js` / `.js.map`), so React Native builds (`main.jsbundle`(.map) on iOS, `index.android.bundle`(.map) on Android) were skipped and the command failed with "no .js.map files found". Broaden the directory walk to also collect `.jsbundle`(.map) and `.bundle`(.map) files via a shared `isSourceMapUploadFile` helper. Each map keeps its own name, so it is stored under the key the backend looks up for a matching frame (`<fileName>.map`), and the minified bundle is uploaded alongside it (as with `.js`) so its `sourceMappingURL` and columns resolve. Co-authored-by: Cursor <cursoragent@cursor.com>
Vadman97
approved these changes
Jul 9, 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.
Summary
ldcli sourcemaps uploadonly discovered web bundles (.js/.js.map), so React Native builds were skipped and the command failed withno .js.map files found. React Native'sreact-native bundleproduces:main.jsbundle+main.jsbundle.mapindex.android.bundle+index.android.bundle.mapThis broadens the directory walk to also collect
.jsbundle(.map) and.bundle(.map) files, via a sharedisSourceMapUploadFilehelper.Why this resolves at lookup time (not just passing the filter)
Each map is uploaded under its own name, so its storage key is
<version>/<basePath>/main.jsbundle.map. The backend looks up a frame's sourcemap as<frameFileName>.map(mapFileForJS), and React Native frames referencemain.jsbundle/index.android.bundle— so the uploaded map matches. The minified bundle is uploaded alongside the map (mirroring how.jsis uploaded with.js.map) so the backend can read itssourceMappingURLand resolve columns.Repro (before)
After this change the same command uploads
main.jsbundle/main.jsbundle.map(and the Android equivalents) directly — no renaming needed.Changes
sourceMapUploadSuffixes+isSourceMapUploadFileand use it ingetAllSourceMapFiles..jsbundle,.jsbundle.map,.bundle,.bundle.mapin addition to.js/.js.map.Test plan
go test ./cmd/sourcemaps/...passesgo build ./cmd/sourcemaps/...andgofmtcleanTestIsSourceMapUploadFilecovers web + RN iOS/Android bundles/maps and rejects.css/.css.map/.mdTestGetAllSourceMapFilesReactNativeverifies the four RN filenames are discovered and a non-sourcemap file is skippedMade with Cursor