with one click
sentry-javascript-sourcemaps
// Upload source maps to Sentry via wizard, bundler plugins (Webpack/Vite/Rollup/esbuild), or CLI — Debug ID injection, CI integration, and troubleshooting.
// Upload source maps to Sentry via wizard, bundler plugins (Webpack/Vite/Rollup/esbuild), or CLI — Debug ID injection, CI integration, and troubleshooting.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | sentry-javascript-sourcemaps |
| description | Upload source maps to Sentry via wizard, bundler plugins (Webpack/Vite/Rollup/esbuild), or CLI — Debug ID injection, CI integration, and troubleshooting. |
| tech_stack | ["frontend"] |
| language | javascript |
| capability | ["observability","ci-cd"] |
| version | Sentry JavaScript SDK unversioned |
| collected_at | "2025-01-01T00:00:00.000Z" |
Source: https://docs.sentry.io/platforms/javascript/sourcemaps/, https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/, https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/
Upload source maps to Sentry so production stack traces resolve to original source code instead of minified bundles. Covers the Sentry Wizard, per-bundler plugins (Webpack, Vite, Rollup, esbuild), Sentry CLI manual uploads, Debug ID injection, CI integration, and common troubleshooting.
npx @sentry/wizard@latest -i sourcemaps
The wizard interactively logs you into Sentry, selects your project, installs the right plugin packages, and configures your build tool. It also guides you through CI setup.
Vite (recommended for new projects):
npm install @sentry/vite-plugin --save-dev
// vite.config.js
import { defineConfig } from "vite";
import { sentryVitePlugin } from "@sentry/vite-plugin";
export default defineConfig({
build: { sourcemap: true },
plugins: [
sentryVitePlugin({
org: "your-org",
project: "your-project",
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});
Webpack:
npm install @sentry/webpack-plugin --save-dev
// webpack.config.js
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
module.exports = {
devtool: "source-map",
plugins: [
sentryWebpackPlugin({
org: "your-org",
project: "your-project",
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
};
# Upload a directory of source maps
sentry-cli sourcemaps upload ./dist
# With release association (recommended)
sentry-cli releases new my-app@2.0.0
sentry-cli sourcemaps upload ./dist --release my-app@2.0.0
| Bundler | Package | Config file |
|---|---|---|
| Vite | @sentry/vite-plugin | vite.config.js |
| Webpack | @sentry/webpack-plugin | webpack.config.js |
| Rollup | @sentry/rollup-plugin | rollup.config.js |
| esbuild | @sentry/esbuild-plugin | esbuild config |
| Option | Required | Purpose |
|---|---|---|
org | Yes | Sentry organization slug |
project | Yes | Sentry project slug |
authToken | Yes | Sentry auth token (use env var, never commit) |
release | No | Release name to associate source maps with |
sourcemaps.assets | No | Glob pattern for source files (default: ./dist/**) |
npx @sentry/wizard@latest -i sourcemaps # guided setup
sentry-cli sourcemaps upload ./dist # manual upload
sentry-cli releases new <name> # create release
sentry-cli sourcemaps upload ./dist --release <name> # upload with release
SENTRY_AUTH_TOKEN — always pass it as an environment variable..map files publicly unless intentional — they expose original source code. Upload to Sentry instead.release value in both Sentry.init() and your source map upload for reliable matching."hidden-source-map" devtool mode or configure upload globs to exclude unnecessary files.release in Sentry.init(), which must match the release used during source map upload.release option keyed to your Git SHA or version tag.sourcemaps.assets globs to only upload the relevant package's output.