Skip to content

DebugImage has no sourcemap variant, so events carrying JS debug IDs fail to deserialize #1267

Open

Description

@haithemobeidi

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

0.42.0

Steps to reproduce

  1. Build a Tauri 2 app that uses tauri-plugin-sentry, so the browser SDK
    routes envelopes to the Rust SDK over IPC.
  2. Build the frontend with @sentry/vite-plugin active (default config), which
    injects per-chunk debug IDs.
  3. Throw an error in the frontend.

Minimal reproducer from the original report:
https://github.com/ottosson/sentry-vite-plugin-repro

Once debug IDs are injected, @sentry/browser attaches
debug_meta.images[{ "type": "sourcemap", ... }] to every event.

Expected result

The event deserializes and is sent, as it does when the bundler plugin is absent
or sourcemaps: { disable: true } is set.

Actual result

symbolic / proguard / wasm, with no sourcemap variant and no catch-all.
Envelope::from_slice eagerly parses the event item, hits the unknown variant,
and returns InvalidItemPayload.

Downstream, tauri-plugin-sentry's if let Ok(...) has no error arm, so 100%
of frontend events are dropped with no diagnostic. Rust-side panics keep
arriving, so the project looks healthy while all JS telemetry is gone.

This was root-caused in detail by @ottosson here (2026-06-02):
getsentry/sentry-javascript-bundler-plugins#916
Cross-posted at getsentry/sentry-tauri#35

Both threads are on the bundler plugin's tracker, but the change has to happen
in this crate and I couldn't find an issue here, so I'm filing one.

Verified against master today: still no variant. Same at 0.42.0 and 0.46.2, so
a version bump doesn't help.

Suggested fix, either or ideally both:

  1. Add the variant. The wire name is sourcemap, not snake_case source_map,
    so it needs an explicit #[serde(rename = "sourcemap")].
  2. Add a catch-all so an unknown image type can't fail the whole event. This is
    the more valuable half: this enum deserializes data produced by other Sentry
    SDKs on independent release cycles, so a future variant will do this again.

Attribution note: both suggested fixes above are @ottosson's, from the linked
comment on bundler-plugins#916, including the Other(Map<String, Value>) catch-all
and the observation that the Context enum in this same file already has one. I'm
filing here because the change belongs in this crate and I couldn't find an issue
for it on this tracker.

Activity

  1. added
    Bug
    Rust
    on Jul 25, 2026
  2. linear-code commented on Jul 25, 2026

    @linear-code
  3. sidsri14 commented on Jul 25, 2026

    @sidsri14
  4. szokeasaurusrex commented on Jul 27, 2026

    @szokeasaurusrex
    Member

    Hi @haithemobeidi, thank you for reporting, and for the detailed investigation! I am adding this to our backlog, looks like a valid bug.

  5. szokeasaurusrex commented on Aug 2, 2026

    @szokeasaurusrex
    Member

    Hi @haithemobeidi, I investigated this a bit more.

    Unfortunately, the specific fixes proposed here (adding a SourceMap variant and a catch-all variant) would require breaking changes to the SDK’s public API because they would add variants to the DebugImage enum, which is public and exhaustive.

    The sentry-tauri plugin does not appear to be widely used, and it is not an official Sentry product. While this is a valid issue, I do not believe it would justify issuing a breaking SDK release solely for this fix. I will therefore label the issue as a breaking change, and we will aim to include typed support in the next breaking release. We do not currently have a timeline for that release, but it is likely at least a few months away.

    In the meantime, the problem can be mitigated in the sentry-tauri plugin. The plugin silently ignores envelopes that the Rust SDK fails to deserialize by handling only the Ok variant of the Result. It should likely log the parse error and fall back to Envelope::from_bytes_raw, preserving the original envelope bytes for forwarding without parsing them.

    This is not an ideal solution because the Rust-side typed event preprocessing will not run for the fallback path. In particular, the plugin will not be able to modify the event or move attachments into the Rust scope. That preprocessing is a central purpose of sentry-tauri. However, preserving and forwarding the original envelope is likely preferable to losing the event entirely. It is also more robust than adding support only for the sourcemap debug-image type, since it would preserve events containing other valid protocol fields that this SDK version does not understand.

  6. added and removed
    Bug
    on Aug 2, 2026
  7. ottosson commented on Aug 10, 2026

    @ottosson

    I'm using a fixed fork until the fix lands upstream. I've tested it and verified that it's working. I'll just add it here If it's of any value at all to you: master...ottosson:sentry-rust:sourcemap-debug-image-0.49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions