Why Source Maps Matter
Without source maps, production errors look like this:Quick Start
Next.js
Source maps are configured automatically:Vite
Webpack
Source Map Types
For Production
For Development
Authentication
Auth Token (Recommended)
Create an auth token in Sentry:- Go to Settings → Auth Tokens
- Create a token with
project:releasesscope - Store in environment variable:
API Key (Legacy)
Upload Configuration
Basic Upload
Advanced Options
Release Management
Automatic Release Detection
The plugin tries to detect the release automatically from:SENTRY_RELEASEenvironment variable- Git commit SHA
- CI environment variables
Manual Release Name
Matching SDK Release
Ensure your SDK uses the same release: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
Source maps not applied to events
Source maps not applied to events
Symptoms: Stack traces show minified codeSolutions:
-
Verify release name matches:
-
Check URL prefix:
-
Ensure source maps are uploaded:
'File not found' errors
'File not found' errors
Symptoms: Sentry shows “file not found” in stack tracesSolutions:
- Verify
urlPrefixmatches production URLs - Check that files were uploaded:
- Ensure filenames match exactly (case-sensitive)
Partial source maps
Partial source maps
Symptoms: Some files have source maps, others don’tSolutions:
-
Check
includepaths: -
Verify all builds generate source maps:
Framework-Specific Guides
React (Create React App)
Vue CLI
Angular
Svelte (SvelteKit)
CI/CD Integration
GitHub Actions
GitLab CI
Manual Upload with Sentry CLI
Security Best Practices
Delete source maps after upload
Delete source maps after upload
Remove source maps from your deployment:
Restrict source map access
Restrict source map access
In Sentry, limit who can view source code:
- Go to Settings → General Settings
- Configure “Data Scrubbing”
- Enable “Scrub data before sending”
Use separate builds for development
Use separate builds for development
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