Provenance
Error Tracking

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

  1. Build your app with source map generation enabled
  2. Upload the .map files to Provenance, associated with a release
  3. When an error is captured, the BFF resolves stack frames against the uploaded maps
  4. The UI displays the original source file, function, and line number

Uploading Source Maps

provenance sourcemaps upload \
  --origin my-app \
  --release 1.2.3 \
  ./dist

The 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.js

Required environment variables:

  • PROVENANCE_API_URL or NEXT_PUBLIC_PROVENANCE_API_URL
  • PROVENANCE_API_KEY or NEXT_PUBLIC_PROVENANCE_API_KEY
  • PROVENANCE_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 mapped badge)
  • 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:

PlanMax Releases with Source Maps
Free3
Pro30
Business100
EnterpriseUnlimited

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.