Source Maps
Upload your source maps to Sentry to enable readable stack traces in your errors.
To enable readable stack traces in your Sentry errors, you need to upload your source maps to Sentry.
The easiest way to configure uploading source maps is by using the Sentry Wizard.
npx @sentry/wizard@latest -i sourcemaps
Note: Source maps are only generated and uploaded during production builds (wrangler deploy
). Development builds (wrangler dev
) do not generate source maps for upload.
See how uploading source maps lets you see the exact line of code that caused an error:
If you are using plain Cloudflare Workers, set upload_source_maps = true
in your wrangler.jsonc
/wrangler.toml
config file to enable source map generation.
wrangler.jsonc
{
"upload_source_maps": true,
}
For more detailed configuration options, see the Cloudflare Workers guide.
The easiest way to configure uploading source maps is by using the Sentry Wizard:
npx @sentry/wizard@latest -i sourcemaps
The wizard will guide you through the following steps:
- Logging into Sentry and selecting a project
- Installing the necessary Sentry packages
- Configuring your build tool to generate and upload source maps
- Configuring your CI to upload source maps
If you want to configure source maps to upload manually, follow the guide for your bundler or build tool below.
- TypeScript (tsc)
If you're using a bundler like Webpack, Vite, Rollup, or Esbuild, use the corresponding Sentry plugin instead. For details, see the "Sentry Bundler Support" section.
- UglifyJS
- SystemJS
If you're not using one of these tools, we assume you already know how to generate source maps with your toolchain and we recommend you upload them using Sentry CLI.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").