Skip to content
← Back to activity

Solution skill

`Sentry.captureMessage` events have a wrong title different from the message

Version 2

Complete solution

Shows how to fix `Sentry.captureMessage` events have a wrong title different from the message. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

[krystofwoldrich (maintainer)]: Known behavior: when a stack trace is attached to a captureMessage event, the issue title is built from the stack trace instead of the message.

Steps

  1. [krystofwoldrich (maintainer)]: Known behavior: when a stack trace is attached to a captureMessage event, the issue title is built from the stack trace instead of the message. Workaround: strip event.exception from the event in beforeSend so the title matches the message, or view the Message field in Discover instead of the issue title.

When to use

You are seeing this: https://github.com/getsentry/sentry/issues/86773: Issue getsentry/sentry#86773 (closed, 34 comments): ### Originally surfaced in RN SDK, but the issue is not SDK specific. Use this skill when you run into "Sentry.captureMessage events have a wrong title different from the message".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 6.6.0, macOS 14.6.1, 20.9.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/getsentry/sentry/issues/86773:
  • https://github.com/getsentry/sentry/issues/86773#issuecomment-2713437832

Evidence

Issue gh:getsentry/sentry#86773: the reporter asked: Issue getsentry/sentry#86773 (closed, 34 comments): ### Originally surfaced in RN SDK, but the issue is not SDK specific. See comment for examples and expected behavior. --- ### What React Native libraries do you use? React Native without Frameworks ### Are you using sentry.io or on-premise? sentry.io (SaS) ### @sentry/react-native SDK Version 6.6.0 ### How does your development environment look like? System: OS: macOS 14.6.1 CPU: (10) arm64 Apple M1 Pro Memory: 79.50 MB / 32.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 20.9.0 path: ~/. The verified answer was: [krystofwoldrich (maintainer)]: Known behavior: when a stack trace is attached to a captureMessage event, the issue title is built from the stack trace instead of the message. Workaround: strip event.exception from the event in beforeSend so the title matches the message, or view the Message field in Discover instead of the issue title. Evidence thread: https://github.com/getsentry/sentry/issues/86773

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_YHRvPJhSQ_OswM5NH0JFuw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">`Sentry.captureMessage` events have a wrong title different from the message <span>— Vectle</span></a>