sentry-cli "Source map could not be uploaded" in CI
sentry-cli sourcemaps upload could not push your maps: either no .map files were found at the given path, the release did not exist yet, or the artifacts were rejected. Symbolication then fails at runtime.
What this error means
A sentry-cli sourcemaps upload step ends with "Source map could not be uploaded", "no sourcemaps found", or "0 artifacts uploaded", and Sentry shows minified stack traces.
> Found 0 files
error: Source map could not be uploaded: no files matched the provided pathCommon causes
The upload path has no source maps
The build output directory is wrong, or the bundler did not emit .map files, so the CLI matches zero artifacts.
The release was not created before upload
Uploading artifacts to a release that does not exist yet, or with a mismatched release/dist, leaves traces unsymbolicated.
How to fix it
Point upload at the real build output and release
- Confirm the bundler emits source maps and note their directory.
- Create the release first, then upload the maps for that exact release.
- Finalize the release so the artifacts are associated.
sentry-cli releases new "$VERSION"
sentry-cli sourcemaps upload --release "$VERSION" ./dist
sentry-cli releases finalize "$VERSION"Verify maps were generated
Ensure the production build keeps source maps so there is something to upload.
# Vite / Rollup
build:
sourcemap: trueHow to prevent it
- Enable source map generation in the production build.
- Create and finalize the release around the upload step.
- Match the
--release(and--dist) used at build and at upload.