Skip to content

Sentry.lastEventId() doesn't work on SSR #19217

@Asghar-Lyft

Description

@Asghar-Lyft

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

v10.37.0

Framework Version

v15.4.5

Link to Sentry event

I cannot provide URL at the moment, but this is the event ID 61acc185103343af8dcb1621464fd566 if it doesn't work let me know to provide you URL

Reproduction Example/SDK Setup

No response

Steps to Reproduce

I don't know! When an error happen in CSR (browser) everything works well, but for SSR (node) lastEventId doesn't work

Expected Result

Sentry should capture errors and the Sentry.lastEventId() should return a string and in the Sentry dashboard , we should find the event by searching id:EVENT_ID

Actual Result

Closely related to #19166

when I search id:EVENT_ID in Sentry dashboard in All Issues tab, it doesn't list the issue and

  • For the id returned by captureException it shows Error lading chart data
  • I copied captureUnderscoreErrorException to my repo and changed it to return event ID, in Sentry dashboard search leads to Error fetching releases error

I have a few different projects and they use different version of Next.js and Sentry, I don't want to add many details here, the important part is that

  1. on Next.js v14.2.29 and SDK v8.3.0everything works well
  2. but on Next.js v15.4.5 and SDK v10.37.0 only client-side error capturing works and server-side doesn't work well and I cannot find the event-id of the server-side error

Sentry.lastEventId() also doesn't work in SDK v10.37.0 but works on SDK v8.3.0

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions