Uploading source maps

Upload JavaScript or TypeScript source maps by integrating your existing Sentry Source Map Upload with Better Stack. All of the Sentry-supported JavaScript build-system integrations and manual uploads should work as-is.

Browser JavaScript / TypeScript

React Native

Using Flutter, Dart, or native mobile builds?

Source map upload covers JavaScript and TypeScript builds only.

Debug symbols for mobile platforms, such as iOS dSYMs, Android ProGuard/R8 mappings, and Dart symbol files from Flutter's --split-debug-info, can't be uploaded yet. Stack traces from obfuscated mobile release builds won't be symbolicated. Learn more about Flutter and Dart release builds.

Upload source maps during build

To configure your build process to upload source maps to Better Stack, follow the "Manual Setup" steps for any of the linked build processes above.

We do not currently support publicly-hosted source maps, and require you to upload them.

If you need public source maps, or have any issues uploading source maps for one of the above types, please get in touch at hello@betterstack.com.

Update the configuration values or environment variables from the values in Errors -> Applications -> your application -> Advanced settings tab.

  • org or SENTRY_ORG - A Better Stack ID representing your team.
  • project or SENTRY_PROJECT - The Better Stack ID for your application.
  • url or SENTRY_URL - The Better Stack endpoint source maps are uploaded to, for example https://us-east-9-sourcemaps.betterstackdata.com.
  • authToken or SENTRY_AUTH_TOKEN - This is a Telemetry API token.

Ensure you don't commit your BETTER_STACK_API_TOKEN to source control, as it also gives access to your Telemetry account. Use an uncommitted env file or CI secrets management instead.

Here are a few examples:

Webpack Vite .env file
sentryWebpackPlugin({
  org: $SENTRY_ORG,
  project: $SENTRY_PROJECT,
  url: $SENTRY_URL,
  authToken: process.env.BETTER_STACK_API_TOKEN
})
sentryVitePlugin({
  org: $SENTRY_ORG,
  project: $SENTRY_PROJECT,
  url: $SENTRY_URL,
  authToken: process.env.BETTER_STACK_API_TOKEN
})
SENTRY_ORG=$SENTRY_ORG
SENTRY_PROJECT=$SENTRY_PROJECT
SENTRY_AUTH_TOKEN=$BETTER_STACK_API_TOKEN
SENTRY_URL=$SENTRY_URL

Check that your upload worked

Your latest five uploads show under Upload source maps in your application's Advanced settings tab. Click View all uploads to see older ones.

Each upload has one of these statuses:

  • Processing: Large uploads can take a few minutes. Errors that arrive before then won't be symbolicated.
  • Processed: Your source maps are ready. Files mapped shows how many of the uploaded files got a source map, for example 112 of 115. A few files without one are normal.
  • Failed: The upload couldn't be processed. Hover over Failed to see why.

Seeing two uploads for one release?

Frameworks that build your app twice, such as SvelteKit, upload source maps once for the server build and once for the client build. Both uploads are expected.

See the expanded source maps in Better Stack

Once an upload is Processed, new errors show detailed stack frames with your original file names and line numbers.

Upload limits

Each upload, such as one sentry-cli sourcemaps upload run, can hold up to:

  • 50,000 files. A minified file and its source map count as one.
  • 4 GiB in total, uncompressed.
  • 100 MiB in any single minified file or source map.

An upload over a limit is rejected right away, even without --wait. sentry-cli then fails with error: Failed to process uploaded files: and the reason. The Sentry build plugins log the reason and let the build finish.