Skip to content

Seeing captureException is not a function error #11592

@azymnis

Description

@azymnis

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.110.0

Framework Version

18.2.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
      dsn: SentryDSNURL,
      environment: isStaging() ? 'staging' : 'prod',
      maxValueLength: 1_000_000,
      integrations: [
        // enable HTTP calls tracing
        new Sentry.Integrations.Http({ tracing: true }),
        // enable Express.js middleware tracing
        new Sentry.Integrations.Express({ app }) as any,
        new ProfilingIntegration() as any,
      ],

      // Performance Monitoring
      tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
      // Set sampling rate for profiling - this is relative to tracesSampleRate
      profilesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
    });

Steps to Reproduce

This error does not happen always. In some cases we get this error message in the sentry express error handler:

this.getScope(...).captureException is not a function

This does not happen consistently and so is hard to reproduce

Expected Result

Not seeing this error

Actual Result

Error messages get swallowed by sentry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions