Skip to main content
Source maps translate minified production code back to readable source code, making error stack traces actionable in Sentry.

Why Source Maps Matter

Without source maps, production errors look like this:
With source maps:

Quick Start

Next.js

Source maps are configured automatically:
In Next.js SDK v9+, client-side source maps are automatically deleted after upload to keep them private.

Vite

Webpack

Source Map Types

For Production

For Development

Authentication

Create an auth token in Sentry:
  1. Go to Settings → Auth Tokens
  2. Create a token with project:releases scope
  3. Store in environment variable:
Never commit auth tokens to version control. Use environment variables or CI secrets.

API Key (Legacy)

Upload Configuration

Basic Upload

Advanced Options

Release Management

Automatic Release Detection

The plugin tries to detect the release automatically from:
  1. SENTRY_RELEASE environment variable
  2. Git commit SHA
  3. CI environment variables

Manual Release Name

Matching SDK Release

Ensure your SDK uses the same release:
Source maps won’t work if the release name in Sentry.init() doesn’t match the release used during upload.

URL Prefix Configuration

Same Origin

Nested Path

CDN Hosting

Multiple Bundles

Debugging Source Maps

Verify Upload

Check if source maps were uploaded:

Validate Source Maps

Common Issues

Symptoms: Stack traces show minified codeSolutions:
  1. Verify release name matches:
  2. Check URL prefix:
  3. Ensure source maps are uploaded:
Symptoms: Sentry shows “file not found” in stack tracesSolutions:
  1. Verify urlPrefix matches production URLs
  2. Check that files were uploaded:
  3. Ensure filenames match exactly (case-sensitive)
Symptoms: Some files have source maps, others don’tSolutions:
  1. Check include paths:
  2. Verify all builds generate source maps:

Framework-Specific Guides

React (Create React App)

Vue CLI

Angular

Then use webpack plugin or upload manually.

Svelte (SvelteKit)

CI/CD Integration

GitHub Actions

GitLab CI

Manual Upload with Sentry CLI

Security Best Practices

Prevent exposing source code to users:
Remove source maps from your deployment:
In Sentry, limit who can view source code:
  1. Go to Settings → General Settings
  2. Configure “Data Scrubbing”
  3. Enable “Scrub data before sending”
Different source map types for different environments:

Troubleshooting Commands

Complete Example

Next Steps

Error Handling

Best practices for capturing errors

Bundle Size

Optimize SDK bundle size