Source maps

Production JavaScript is minified, so error stacks point at lines like index-3f2a9c1b.js:1:48213. Upload your build's source maps for each release and Error tracking shows the original file, line, function name and the surrounding code instead. Stored events are never changed: stacks are mapped when you open an issue, so maps uploaded after a deploy also apply to errors already captured from that release.

1. Tag events with a release

ts
traceiq.initialize({
  projectId: 'YOUR_PROJECT_ID',
  writeKey: 'YOUR_PROJECT_WRITE_KEY',
  release: process.env.NEXT_PUBLIC_RELEASE, // e.g. the git SHA or 1.4.2
});

Use the same value when you upload. Mobile SDKs report the app version, which is used when no release is set.

2. Build with source maps

Vitebuild.sourcemap: 'hidden'Writes .map files without a sourceMappingURL comment, so browsers never fetch them.
Next.jsproductionBrowserSourceMaps: trueThen upload from .next (frames under /_next/static/... match).
webpackdevtool: 'hidden-source-map'Same as Vite’s hidden option.
esbuild--sourcemap=externalWrites .map files without a comment.

3. Upload from CI

Create a personal access token with only the sourcemaps:write scope (Settings → Personal access tokens) and store it as a CI secret. Then, after the build:

yaml
- name: Upload source maps to TraceIQ
  run: npx traceiq-cli sourcemaps upload --release ${{ github.sha }} --dir dist --delete-after
  env:
    TRACEIQ_TOKEN: ${{ secrets.TRACEIQ_TOKEN }}
    TRACEIQ_PROJECT_ID: YOUR_PROJECT_ID
--releaseTRACEIQ_RELEASERequired. Must equal the SDK release option.
--dirdistBuild output folder. Every *.js.map under it is uploaded, gzipped.
--delete-afteroffDelete the local .map files after a successful upload so they are not deployed.
--dry-runoffList the maps that would be uploaded.

Each map is stored under the path of the file next to it (dist/assets/index.js.map → assets/index.js) and matches stack frames whose URL path ends with that path, so it does not matter which domain or CDN serves the bundle. Uploading the same release again replaces its maps. Maps can be up to 25 MB each; traceiq sourcemaps list shows what has been uploaded.