Source maps
Minified production bundles produce stack traces like at e (main.x7d8.js:1:42718) — useless. Upload your .map files at build time and tinymon resolves frames to your original source: filename, line, function, and a few lines of code context.
Why upload them
tinymon resolves frames on the server when an error arrives — you do not ship maps to your users. Maps stay private. Resolution is additive: the raw minified frame is always kept too, with a one-click toggle in the dashboard.
The CLI
The tinymonjs npm package ships a tinymon-sourcemaps binary. Run it as the last step of your deploy:
$ npm install --save-dev tinymonjs $ npx tinymon-sourcemaps \ --url https://console.tinymon.dev \ --token $TINYMON_UPLOAD_TOKEN \ --release "$(git rev-parse --short HEAD)" \ --path ./dist
It walks --path recursively, uploads every .map (and the matching .js if present), and prints what landed.
$TINYMON_UPLOAD_TOKEN: in console.tinymon.dev → project → settings → Source maps. It starts with tm_up_, is separate from your DSN, and must not ship to clients. Store it as a CI secret.
The release contract
tinymon matches frames to maps by (project_id, release, filename). The --release you pass to the CLI must equal the release you pass to init() in the same build:
import { init } from 'tinymonjs'; init({ dsn: process.env.TINYMON_DSN, release: process.env.GIT_SHA, // same value as --release above });
If they differ, tinymon will refuse to resolve against a different release rather than report wrong line numbers — silently mismatching is worse than no resolution.
Vite
// vite.config.ts export default defineConfig({ build: { sourcemap: true }, });
Maps land in dist/assets/. Pass --path ./dist to the CLI.
webpack / Next.js
Next.js with productionBrowserSourceMaps: true in next.config.js emits maps under .next/static/. Pass --path .next/static.
For Vercel deploys, run the CLI after vercel build and before vercel deploy, or as a post-deploy step that has the build artifacts.
When resolution falls back
Every frame is shown honestly. If resolution can't happen, the frame keeps its raw form and is badged with a reason:
| Reason | What it means |
|---|---|
| no source map | No artifact uploaded for this file (e.g. a vendor chunk). |
| no source map for this release | No artifact uploaded for the release the event came from. |
| position out of range | Map exists but the (line, column) isn't inside it. |
| map parse failed | The uploaded file isn't valid source-map JSON. |
If you upload the map after the event arrived, tinymon resolves lazily on the next view of that issue and stores the result so subsequent views are instant.
Security
- Maps are stored in a private Supabase Storage bucket. They're never served publicly.
- Upload tokens are per project. Rotating one invalidates the old token immediately.
- Only
.map,.js,.mjs,.cjsare accepted. 25MB per-file cap.