Skip to main content

[JavaScript] How do I verify Debug IDs for source maps?

Issue

Stack traces stay minified after I uploaded source maps. I need to confirm Debug IDs are on the event and that a matching artifact is already uploaded.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • JavaScript SDK 7.47.0 or later (7.56.0 or later if you use RewriteFrames)

  • Source maps and Debug IDs

  • sentry-cli 2.17.0 or later, JavaScript bundler plugins 2.0.0 or later, or getsentry/action-release@v3

  • Self-hosted Sentry 23.7.0 or later (older self-hosted builds use the legacy upload path)

Symptoms

  • Event JSON has no debug_meta key

  • Searching Source Maps for the event’s Debug ID returns no artifact

  • Stack traces stay minified after a successful upload

Resolution

Confirm five things in order: SDK version, a tool that injects Debug IDs, debug_meta on the event, a matching uploaded artifact, and that the upload happened before the event.

If you need to check the SDK version:

Open the event. The SDK name and version are at the bottom of the event. Debug IDs require JavaScript SDK 7.47.0 or later. If the project uses RewriteFrames, use 7.56.0 or later.

[Screenshot: the SDK section at the bottom of the event, showing Name sentry.javascript.vue and Version 7.54.0.]

Screenshot 2023-08-20 at 11.01.56 PM.png

If you need to check Debug ID injection:

Upload with a tool that injects Debug IDs into the files you deploy:

  • sentry-cli 2.17.0 or later (sentry-cli sourcemaps inject before sentry-cli sourcemaps upload)

  • Official JavaScript bundler plugins 2.0.0 or later (webpack, Vite, Rollup, esbuild)

  • getsentry/action-release@v3 with a sourcemaps path (injection is on by default)

The Netlify build plugin does not inject Debug IDs. Use sentry-cli or a bundler plugin instead.

If you used the source maps wizard (npx @sentry/wizard@latest -i sourcemaps), confirm package.json has an inject step. The wizard often adds a sentry:sourcemaps script that runs sentry-cli sourcemaps inject then sentry-cli sourcemaps upload.

[Screenshot: package.json scripts. build runs sentry:sourcemaps. That script runs sentry-cli sourcemaps inject ./build then sentry-cli sourcemaps upload.]

Screenshot 2023-08-29 at 11.08.22 AM.png

If you need to check the event payload:

Open the event JSON and find debug_meta. Each stack file needs a debug_id under debug_meta.images. Those IDs are present even when Sentry has not found a matching source map yet.

If debug_meta is missing, the deployed files are not the injected build. Inject Debug IDs before you deploy, and deploy those same files.

Then check that each raw_stacktrace frame abs_path matches a debug_meta.images[].code_file value.

[Screenshot: event JSON debug_meta.images[0] with code_file http://localhost:3000/assets/index-15097517.js, debug_id 995b79ce-3370-4057-ab03-9840a78999d2, and type sourcemap.]

Screenshot 2023-08-20 at 11.08.50 PM.png

If you need to match an uploaded artifact:

Copy a debug_id from the event JSON. In Project Settings → Source Maps → Artifact Bundles, search for that ID. A match means the bundle that contains that Debug ID is uploaded.

With bundler plugins, artifact filenames inside the bundle can be the Debug ID rather than the original file name. Ignore the Bundle ID in the result row. Match on the Debug ID you copied.

[Screenshot: Artifact Bundles search for Debug ID 995b79ce-3370-4057-ab03-9840a78999d2 returning a bundle. The Bundle ID is a different UUID. Artifacts count is 2.]

Screenshot 2023-08-20 at 11.09.57 PM.png

If source maps were uploaded after the event:

Sentry does not reprocess old events. Upload artifacts before errors occur. Only new events after the upload can use those maps.

See What are Debug IDs, Troubleshooting Source Maps, and GitHub Actions source maps. To see how a frame was resolved, see How were my source maps resolved?. If the debugger reports no errors and the stack is still wrong, see Why are my source maps still not working?.

Did this answer your question?