Source Maps
Upload source maps to resolve minified stack traces
Source Maps
Upload source maps to resolve minified/bundled stack traces back to original source code. This makes error stack traces readable and actionable.
How It Works
- Build your app with source map generation enabled
- Upload the
.mapfiles to Provenance, associated with a release - When an error is captured, the BFF resolves stack frames against the uploaded maps
- The UI displays the original source file, function, and line number
Uploading Source Maps
provenance sourcemaps upload \
--origin my-app \
--release 1.2.3 \
./distThe CLI recursively scans the directory for .map files and uploads each one.
curl -X POST \
https://your-api/api/origins/my-app/releases/{releaseId}/sourcemaps \
-H "x-api-key: your-key" \
-F "file=@dist/main.js.map" \
-F "filePath=main.js"The origin identifier can be a UUID or a mnemonic.
For CI/CD pipelines, use the included upload script as a post-build step:
# Render build command
npm install; NEXT_PUBLIC_RELEASE_VERSION=$RENDER_GIT_COMMIT npm run build && node scripts/upload-sourcemaps.jsRequired environment variables:
PROVENANCE_API_URLorNEXT_PUBLIC_PROVENANCE_API_URLPROVENANCE_API_KEYorNEXT_PUBLIC_PROVENANCE_API_KEYPROVENANCE_ORIGIN_ID— origin UUID or mnemonic
The script creates a release, uploads all .map files, and removes them from the output directory so they aren't served publicly.
Next.js Configuration
Enable source map generation in your next.config.ts:
const nextConfig: NextConfig = {
productionBrowserSourceMaps: true,
};Turbopack Limitation
Next.js 16 uses Turbopack as the default bundler. Turbopack generates source maps for application code chunks but not for framework/vendor chunks (React runtime, Next.js internals). Errors that surface in framework chunks will show minified function names.
This is a known Turbopack limitation. Errors originating in your application code will resolve correctly when source maps are available.
Resolution
When viewing an error's stack trace:
- Frames with matching source maps are resolved to original source (marked with a
mappedbadge) - Unresolved frames are displayed with shortened filenames
- Resolution happens server-side — original source is never exposed to the client
Retention Limits
Source maps are retained per plan:
| Plan | Max Releases with Source Maps |
|---|---|
| Free | 3 |
| Pro | 30 |
| Business | 100 |
| Enterprise | Unlimited |
When the limit is exceeded, source maps for the oldest releases are automatically deleted. The release records themselves are preserved.
Repository Integration
When an origin has repository config, resolved stack frames link directly to the source code:
{
"repository": {
"provider": "github",
"owner": "myorg",
"repo": "myapp",
"defaultBranch": "main"
}
}Supported providers: GitHub, GitLab, Bitbucket.