Source Maps

Sentry supports demangling of transpiled, minified, and bundled JavaScript using source maps, which are JSON files that contain information about how to map your deployed code back to its original source(s). This lets you view source code context obtained from stack traces in its original, untransformed form. This is particularly useful when debugging minified and/or transpiled code, since both of those processes make large enough changes to the code that it often becomes nearly unrecognizable in its final deployed form. Source maps also allow Sentry to show each line in the stack trace in context, by including additional lines of code on either side.

Source Map Integration Setup

Integrate your project's source maps with Sentry using these steps:

1: Generate Source Maps

Source maps can be generated by transpilers, minifiers, or bundlers you might be using in your project. We provide instructions to configure common tools that output source maps here.

2: Provide Source Maps to Sentry

Source maps can be either:

  1. Uploaded directly to Sentry (strongly recommended)
  2. Served publicly over HTTP alongside your deployed code

If you use Webpack in your project, we recommend generating and uploading your source maps by way of sentry-webpack-plugin. If you use a different tool to generate source maps, you can use sentry-cli to upload them to Sentry.

Learn more about how to upload source maps here.

If you host your source maps alongside your deployed code, make sure your code files end with a `//# sourceMappingURL comment pointing to the corresponding map.

Learn more about publicly hosting source maps here.

Next Steps

Additional Resources

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").