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, but 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:

Copied
$ 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.

The package automatically installs sentry-cli, but you will still need to export your authentication token:

Copied
export SENTRY_AUTH_TOKEN=your-auth-token

Then, add the plugin to your webpack.config.js:

webpack.config.js
Copied
const SentryWebpackPlugin = require("@sentry/webpack-plugin");

module.exports = {
  // other configuration
  configureWebpack: {
    plugins: [
      new SentryWebpackPlugin({
        include: ".",
        ignoreFile: ".sentrycliignore",
        ignore: ["node_modules", "webpack.config.js"],
        configFile: "sentry.properties",
      }),
    ],
  },
};

In Vue 2.x, you should use vue.config.js instead of webpack.config.js, and use include: "./dist" instead of include: "."

Additional information can be found in our Webpack documentation.

Additional Resources

You can edit this page on GitHub.