Skip to content

@sentry/profiling-node does not comply with Integration type #17350

@kostas-pblworks

Description

@kostas-pblworks

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

10.1

Framework Version

Nextjs 15.4 (App Router)

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

instrumentation.ts is set as such:

import * as Sentry from '@sentry/nextjs'

export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {

    const { nodeProfilingIntegration } = await import('@sentry/profiling-node')

    Sentry.init({
      enabled: Boolean(process.env.VERCEL),
      dsn: '****',
      integrations: () => {
        return [Sentry.prismaIntegration(), nodeProfilingIntegration()]
      },

      profileSessionSampleRate: 1.0,
      profileLifecycle: 'trace',
      tracesSampleRate: 1,

      debug: false,
    })
  }
}

Expected Result

To instantiate the nodeProfilingIntegration() and be accepted in the integrations array.

Actual Result

TypeScript error

Type '() => (Integration | Integration)[]' is not assignable to type 'Integration[] | ((integrations: Integration[]) => Integration[]) | undefined'.
  Type '() => (Integration | Integration)[]' is not assignable to type '(integrations: Integration[]) => Integration[]'.
    Type '(Integration | Integration)[]' is not assignable to type 'Integration[]'.
      Type 'Integration | Integration' is not assignable to type 'Integration'.
        Type 'import("/node_modules/@sentry/core/build/types/types-hoist/integration").Integration' is not assignable to type 'import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/types-hoist/integration").Integration'.
          Types of property 'setup' are incompatible.
            Type '((client: import("/node_modules/@sentry/core/build/types/client").Client<import("/node_modules/@sentry/core/build/types/types-hoist/options").ClientOptions<import("/node_module...' is not assignable to type '((client: import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/client").Client<import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/types-hoist/options").ClientOptions<import("/Us...'.
              Type '(client: import("/node_modules/@sentry/core/build/types/client").Client<import("/node_modules/@sentry/core/build/types/types-hoist/options").ClientOptions<import("/node_modules...' is not assignable to type '(client: import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/client").Client<import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/types-hoist/options").ClientOptions<import("/Use...'.
                Types of parameters 'client' and 'client' are incompatible.
                  Type 'import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/client").Client<import("/node_modules/@sentry/nextjs/node_modules/@sentry/core/build/types/types-hoist/options").ClientOptions<import("/Users/kostas...' is not assignable to type 'import("/node_modules/@sentry/core/build/types/client").Client<import("/node_modules/@sentry/core/build/types/types-hoist/options").ClientOptions<import("/node_modules/@sentry/...'.
                    Property '_options' is protected but type 'Client<O>' is not a class derived from 'Client<O>'.ts(2322)
options.d.ts(415, 5): The expected type comes from property 'integrations' which is declared here on type 'Options<BaseTransportOptions> | BrowserOptions | NodeOptions | VercelEdgeOptions'
(property) integrations: () => (Integration | Integration)[]

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions