npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tracewayapp/sourcemap-upload

v2.1.0

Published

CLI tool for uploading source maps to Traceway

Readme

Traceway Source Map Upload CLI

Uploads .map files (and their minified bundles) to your Traceway backend so the dashboard can resolve minified production stack traces back to the original file, line, column, and function name. Run it once per build, after your bundler has emitted the maps.

Traceway is a completely open-source error tracking platform. You can self-host it or use Traceway Cloud.

Version 2.1.0. This package is versioned in lockstep with the Traceway browser SDK. The flags, environment variables and upload endpoint are the same as in 1.x; since 2.1.0 --url is optional and defaults to Traceway Cloud. It works with any version of the Traceway SDKs.

Features

  • Walks a directory and uploads every .map file it finds, plus the matching .js/.cjs/.mjs bundle next to it
  • Single-purpose CLI — no config file, no plugin, just one command
  • Reads credentials from flags or environment variables (CI-friendly)
  • Maps are resolved by filename — the most recent upload of each file wins, so content-hashed bundle names (the default in Vite, Next, etc.) just work
  • Checks every file against the 50 MB limit before it uploads anything, and exits with an error if one is larger

Installation

npm install -D @tracewayapp/sourcemap-upload

This installs 2.x and provides the traceway-sourcemaps command; @tracewayapp/sourcemap-upload@2 pins the major, @1 stays on 1.x. Without installing, npx @tracewayapp/sourcemap-upload runs the same command. Requires Node.js 18, 20, or 22 and newer.

Generate an Upload Token

  1. Open your Traceway dashboard
  2. Go to the Connection page of the project
  3. In the Source Map Upload card, click Generate Upload Token
  4. Copy the token

The upload token is separate from the project token the SDK starts with and only allows uploads for that project. Regenerate on the same card issues a new token and invalidates the current one immediately. Members with the readonly role do not see the card.

Quick Start

Run after your production build:

npx @tracewayapp/sourcemap-upload \
  --token YOUR_SOURCE_MAP_TOKEN \
  --directory dist/assets

The maps go to Traceway Cloud (https://cloud.tracewayapp.com). For a self-hosted server, add --url https://traceway.mycompany.com (or set TRACEWAY_URL): the address of the server, which the CLI reads like the SDK's baseUrl (https:// added when there is no scheme, a trailing /api dropped) before it appends /api/sourcemaps/upload.

The backend resolves each minified stack frame to its map by filename, so there is nothing to configure beyond pointing the CLI at your build output. Re-running the upload replaces the map for any filename it uploads; the most recent upload of each file wins.

Make sure the build actually emits .map files (Vite build.sourcemap: true, Rollup output.sourcemap: true, webpack devtool: "source-map"). With none on disk the CLI prints No .map files found in <dir> and exits with code 0, so the step looks green while nothing was uploaded.

Options

| Flag | Env variable | Required | Description | |------|--------------|----------|-------------| | --url <url> | TRACEWAY_URL | No | Traceway server URL, only for a self-hosted server (default: https://cloud.tracewayapp.com; a trailing slash is ignored) | | --token <token> | TRACEWAY_SOURCEMAP_TOKEN | Yes | Source map upload token from the dashboard | | --directory <dir> | — | No | Directory to search recursively for .map files and their bundles (default: ., the current directory) | | --help, -h | — | No | Print the usage and exit |

A flag takes precedence over its environment variable, and an empty value (an unset CI secret) counts as not given. Write each flag and its value as two arguments (--url https://...); the --url=https://... form is not parsed.

Environment variables

In CI/CD, prefer environment variables so the token is never on the command line:

export TRACEWAY_SOURCEMAP_TOKEN=$TRACEWAY_TOKEN_FROM_SECRETS
# export TRACEWAY_URL=https://traceway.mycompany.com   # only for a self-hosted server

npx @tracewayapp/sourcemap-upload \
  --directory dist/assets

Exit codes

| Code | When | |------|------| | 0 | The upload succeeded (Successfully uploaded N file(s) to <endpoint>), no .map file was found, or --help was printed | | 1 | --token is missing, a file is larger than 50 MB (nothing is uploaded), the request failed, or the backend answered with a non-2xx status (Upload failed (<status>): <body>) |

CI/CD Integration

Add source-map upload as a step after your build, pointing it at your bundler's output directory.

GitHub Actions

- name: Build
  run: npm run build

- name: Upload source maps
  env:
    TRACEWAY_SOURCEMAP_TOKEN: ${{ secrets.TRACEWAY_SOURCEMAP_TOKEN }}
    # TRACEWAY_URL: ${{ vars.TRACEWAY_URL }}   # only for a self-hosted server
  run: npx @tracewayapp/sourcemap-upload --directory dist/assets

GitLab CI

deploy:
  script:
    - npm run build
    - npx @tracewayapp/sourcemap-upload --directory dist/assets

TRACEWAY_SOURCEMAP_TOKEN (and TRACEWAY_URL for a self-hosted server) come from the project's CI/CD variables.

Limits

  • Each uploaded file must be under 50 MB. The CLI checks this itself before it sends anything; the backend rejects a larger file with 400
  • Everything is sent in one request, which the backend caps at 250 MB (413) and 1000 files (422), maps and bundles together. Split a larger build by running the CLI once per subdirectory
  • Every *.map under the directory is uploaded, whatever it maps, so point --directory at the build output. The default . also picks up maps under node_modules
  • Each .map is uploaded with its sibling minified bundle (.js/.cjs/.mjs) when one exists; other siblings (.css, source files, etc.) are ignored. Uploading the bundle is what lets the backend resolve function names — without it, symbolication is location-only
  • Files are stored under their base name, without the directory. Two maps with the same name in different subdirectories overwrite each other
  • Maps are stored permanently and addressed by filename on the backend; re-running the upload overwrites the map for any filename it uploads. Uploads are never auto-deleted or expired.

How Maps Are Matched

There is nothing to wire up at runtime. When an exception arrives, the backend resolves each minified frame in two steps:

  1. By debug ID, when the build used @tracewayapp/bundler-plugin: every bundle and its map share an embedded ECMA-426 debug ID, the upload endpoint detects it in the files automatically, and frames resolve against the map from that exact build, immune to filename collisions and concurrent deploys.
  2. By filename otherwise: the backend looks up the map you uploaded under the frame's filename; the most recent upload wins. Content-hashed bundle filenames (the default in Vite, Next, Angular, and most bundlers) keep every build's maps distinct automatically.

Debug IDs are reported by the browser SDK (@tracewayapp/frontend and its wrappers). @tracewayapp/react-native does not report them, so React Native maps are matched by filename.

Uploads take effect immediately: the backend drops what it had cached for the uploaded filenames before it answers.

The SDK's version option is unrelated to source maps: it is plain metadata shown on exceptions in the dashboard, useful for filtering by build, and you can set it or leave it unset independently of uploads.

Links

License

MIT