Skip to content

Missing debug_id for stacktrace frame happened in event handler (onClick) #12256

@valeryq

Description

@valeryq

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

^8.5.0

Framework Version

14.1.4

Link to Sentry event

https://bellum.sentry.io/issues/5418884569/events/8bf530e7974b4c3c8e501cf0e2577ba9/

SDK Setup

import * as Sentry from '@sentry/nextjs';

import Environments from '@/constants/environments';

Sentry.init({
  dsn: Environments.SENTRY.DSN,
  enabled: Environments.SENTRY.ENABLED,
  environment: Environments.ENV,
  release: Environments.VERSION,
  replaysOnErrorSampleRate: 1.0,
  replaysSessionSampleRate: 0.1,
  tracesSampleRate: 1,
});

// Integrations lazy loading
(async () => {
  const { replayIntegration } = await import('@sentry/nextjs');

  Sentry.addIntegration(replayIntegration({
    blockAllMedia: true,
    maskAllText: false,
  }));
})();

Steps to Reproduce

Just have next component is enough:

const SentryClient = () => {
  const handleClick = () => {
    const t: Array<{ test: string }> = [];

    // t[2] elements doesn't exists, here will be error
    console.log('error here', t[2].test);
  };

  return (
      <button onClick={handleClick}>
        Throw an error
      </Button>
  );
};

Expected Result

debug_id is added to event handlers too to have correct unminified stacktrace

Actual Result

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions