Source Maps

Sentry supports un-minifying JavaScript via source maps, which lets you view source code context obtained from stack traces in their original untransformed form. This is particularly useful for debugging minified code (for example, UglifyJS), or transpiled code from a higher-level language (such as TypeScript and ES6).

Capturing Source Maps

Most modern JavaScript transpilers support source maps. Below you'll find our recommended instructions, though we also provide instructions for various common tools.

We recommend using Sentry's Webpack plugin to configure source maps and upload them automatically during the build:

npm install --save-dev @sentry/webpack-plugin

Next you need to generate an access token for our API. Within your organization's settings, navigate to Developer Settings, create a new internal integration, and provide a name appropriate to your organization. Important: Select Releases -> Admin for Permissions.

You may configure sentry-cli through its documented mechanisms, or instead simply bind required parameters when initializing the plugin:

const SentryWebpackPlugin = require("@sentry/webpack-plugin");

module.exports = {
  // other webpack configuration
  devtool: 'source-map',
  plugins: [
    new SentryWebpackPlugin({
      // sentry-cli configuration
      authToken: process.env.SENTRY_AUTH_TOKEN,
      org: "example-org",
      project: "example-project",
      release: process.env.SENTRY_RELEASE,

      // webpack-specific configuration
      include: ".",
      ignore: ["node_modules", "webpack.config.js"],

Note: The release value provided during source maps upload must match the value in the Sentry.init call.

Additional information can be found in our Webpack documentation.

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").