Sentry CLI
Upload Source Maps Using sentry-cli
When using sentry-cli
to upload source maps, you need to set up your build system to both create a release and upload the various source files corresponding to that release. For Sentry to demangle your stack traces, provide both:
- The deployed files (in other words, the results of your transpilation/minification/bundling process; for example,
app.min.js
) - The corresponding source maps
If the source map files do not contain your original source code (sourcesContent
), you must also provide the original source files. Sentry CLI will attempt to automatically embed the sources in your source maps if they are missing.
Sentry uses releases to match the correct source maps to your events. To create a new release, run the following command (for example, during publishing):
sentry-cli releases new <release_name>
The release name must be unique within your organization and match the release
option in your SDK initialization code. Then, use the upload-sourcemaps
command to scan a folder for source maps, process them, and upload them to Sentry.
sentry-cli releases files <release_name> upload-sourcemaps /path/to/files
You can find the artifacts uploaded to Sentry by navigating to [Project] > Project Settings > Source Maps.
This command will upload all files ending in .js and .map to the specified release. If you wish to change these extensions – for example, to upload typescript sources – use the --ext
option:
sentry-cli releases files <release_name> upload-sourcemaps --ext ts --ext map /path/to/files
Until now, the release is in a draft state (“unreleased”). Once all source maps have been uploaded, and your app has been published successfully, finalize the release with the following command:
sentry-cli releases finalize <release_name>
For convenience, you can pass the --finalize
flag to the new
command, which will immediately finalize the release.
For more information, see our sentry-cli
docs.
It’s not uncommon for a web application to be accessible at multiple origins. See our documentation on multiple origins to learn how to handle this.
- Package:
- npm:sentry-cordova
- Version:
- 1.3.0
- Repository:
- https://github.com/getsentry/sentry-cordova