Skip to content

TypeScript type error possibly caused by type from node perf_hooks that is not imported #17650

Description

@sjsyrek

Important Details

How are you running Sentry?

  • On-Premise docker [Version xyz]
  • Saas (sentry.io)
  • Not running it at all, because I can't even compile my project

Description

When I try to compile my TypeScript project, which uses Sentry, I get this type error:

../../node_modules/@sentry/utils/dist/misc.d.ts:90:53 - error TS2304: Cannot find name 'Performance'.

90 export declare const crossPlatformPerformance: Pick<Performance, 'now' | 'timeOrigin'>;
                                                       ~~~~~~~~~~~

I checked the file referenced above, and my guess is that Performance type needs to be imported from node somehow. It appears to exist in the npm @types/node package under perf_hooks.d.ts.

Steps to Reproduce

I am not sure how to reproduce this or whether it's a problem with my project or Sentry itself.

What you expected to happen

Using Sentry in TypeScript files should not cause type errors.

Possible Solution

Possibly import the above type into the file causing the problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions