Skip to content

Type 'ProfilingIntegration' is not assignable to type 'Integration' #10852

@srujun

Description

@srujun

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.103.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Sentry.init({
    dsn,
    environment,
    tracesSampleRate,
    profilesSampleRate: 1.0,
    enabled: !config.isDev && !config.isTest,
    maxValueLength: 0,
    integrations: [
      new Sentry.Integrations.Http({ tracing: true }),
      new Sentry.Integrations.Express({
        app: expressApp,
      }),
      new ProfilingIntegration(),
      new Sentry.Integrations.GraphQL(),
      new Sentry.Integrations.Prisma({ client: prismaClient }),
      new Sentry.Integrations.Postgres()
    ]
  })

Steps to Reproduce

This error is happening within a typescript project. It seems the @sentry/profiling-node package depends on an older version of @sentry/node or @sentry/types.

Expected Result

No compile error

Actual Result

I get this error:

Type 'ProfilingIntegration' is not assignable to type 'Integration'.
  Types of property 'setupOnce' are incompatible.
    Type '(addGlobalEventProcessor: (callback: import(".../@sentry/types/types/eventprocessor").EventProcessor) => void, getCurrentHub: () => import(".../node_modules/@sentry/types/types/hub").Hub) => void' is not assignable to type '(addGlobalEventProcessor: (callback: import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/eventprocessor").EventProcessor) => void, getCurrentHub: () => import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/hub").Hub) => void'.
      Types of parameters 'addGlobalEventProcessor' and 'addGlobalEventProcessor' are incompatible.
        Types of parameters 'callback' and 'callback' are incompatible.
          Type 'import(".../node_modules/@sentry/types/types/eventprocessor").EventProcessor' is not assignable to type 'import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/eventprocessor").EventProcessor'.
            Types of parameters 'hint' and 'hint' are incompatible.
              Type 'import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/event").EventHint' is not assignable to type 'import(".../node_modules/@sentry/types/types/event").EventHint'.
                Types of property 'captureContext' are incompatible.
                  Type 'import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/scope").CaptureContext | undefined' is not assignable to type 'import(".../node_modules/@sentry/types/types/scope").CaptureContext | undefined'.
                    Type 'Scope' is not assignable to type 'CaptureContext | undefined'.
                      Type 'import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/scope").Scope' is not assignable to type 'import(".../node_modules/@sentry/types/types/scope").Scope'.
                        Types of property 'update' are incompatible.
                          Type '(captureContext?: import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/scope").CaptureContext | undefined) => import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/scope").Scope' is not assignable to type '(captureContext?: import(".../node_modules/@sentry/types/types/scope").CaptureContext | undefined) => import(".../node_modules/@sentry/types/types/scope").Scope'.
                            Types of parameters 'captureContext' and 'captureContext' are incompatible.
                              Type 'import(".../node_modules/@sentry/types/types/scope").CaptureContext | undefined' is not assignable to type 'import(".../node_modules/@sentry/node/node_modules/@sentry/types/types/scope").CaptureContext | undefined'.
                                Type 'Scope' is not assignable to type 'CaptureContext | undefined'.
                                  Type 'Scope' is missing the following properties from type 'Scope': setClient, getClient, getScopeData, captureException, and 2 more.ts(2322)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions