Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

TypeScript error with 7.64.0 version of Sentry packages #190

@SheaBelsky

Description

@SheaBelsky

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

SDK Version

1.1.2

Link to Sentry event

No response

What environment is your node script running in?

Express + Apollo Server

How is your code deployed and bundled?

Azure App Service

Steps to Reproduce

  1. Installed latest (as of 08/23/2023) version of @sentry packages, 7.64.0
  2. Ran npm install
  3. Encounter TypeScript errors in the file with Sentry.init

Expected Result

The plugin works without type casting

Actual Result

src/utils/errors.ts:20:7 - error TS2322: Type 'ProfilingIntegration' is not assignable to type 'Integration'.
  Types of property 'setupOnce' are incompatible.
    Type '(addGlobalEventProcessor: (callback: import("/node_modules/@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/integrations/node_modules/@sentry/types/types/eventprocessor").EventProcessor) => void, getCurrentHub: () => import("/node_modules/@sentry/integrations/node_modules/@sentry...'.
      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/integrations/node_modules/@sentry/types/types/eventprocessor").EventProcessor'.
            Types of parameters 'event' and 'event' are incompatible.
              Type 'import("/node_modules/@sentry/integrations/node_modules/@sentry/types/types/event").Event' is not assignable to type 'import("/node_modules/@sentry/types/types/event").Event'.
                Types of property 'spans' are incompatible.
                  Type 'import("/node_modules/@sentry/integrations/node_modules/@sentry/types/types/span").Span[] | undefined' is not assignable to type 'import("/node_modules/@sentry/types/types/span").Span[] | undefined'.
                    Type 'import("/node_modules/@sentry/integrations/node_modules/@sentry/types/types/span").Span[]' is not assignable to type 'import("/node_modules/@sentry/types/types/span").Span[]'.
                      Type 'import("/node_modules/@sentry/integrations/node_modules/@sentry/types/types/span").Span' is not assignable to type 'import("/node_modules/@sentry/types/types/span").Span'.
                        Types of property 'transaction' are incompatible.
                          Type 'import("/node_modules/@sentry/integrations/node_modules/@sentry/types/types/transaction").Transaction | undefined' is not assignable to type 'import("/node_modules/@sentry/types/types/transaction").Transaction | undefined'.
                            Type 'import("/node_modules/@sentry/integrations/node_modules/@sentry/types/types/transaction").Transaction' is not assignable to type 'import("/node_modules/@sentry/types/types/transaction").Transaction'.
                              The types returned by 'setTag(...)' are incompatible between these types.
                                Type 'Span' is missing the following properties from type 'Transaction': metadata, setContext, setMeasurement, setMetadata, getDynamicSamplingContext

20       new ProfilingIntegration(),

Code snippet:

import { ExtraErrorData } from "@sentry/integrations";
import { ProfilingIntegration } from "@sentry/profiling-node";
import { SENTRY_DSN } from "../models/sentry/data";
import * as Sentry from "@sentry/node";

Sentry.init({
    dsn: SENTRY_DSN,
    integrations: [
      new ExtraErrorData({
        depth: 3
      }),
      new ProfilingIntegration(),
      new Sentry.Integrations.Prisma({ client: prisma })
    ],
    maxValueLength: 1000,
    profilesSampleRate: 0,
    tracesSampleRate: 0.5
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions