Skip to content

TypeScript error after upgrading @sentry/tracing to 5.28.0 #3089

@bausmeier

Description

@bausmeier

Package + Version

  • @sentry/browser
  • @sentry/node
  • @sentry/tracing
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.28.0

Description

After upgrading @sentry/tracing to 5.28.0 we're seeing a TypeScript error when calling the Express constructor with an Express app.

The error is coming from this line:

new Tracing.Integrations.Express({ app }),

The app being passed in is a plain Express app constructed by calling express().

And the error is:

error TS2322: Type 'Express' is not assignable to type 'Router'.
  Types of property 'trace' are incompatible.
    Type 'IRouterMatcher<Express, any>' is not assignable to type '(...args: unknown[]) => unknown'.
      Types of parameters 'path' and 'args' are incompatible.
        Type 'unknown' is not assignable to type 'PathParams'.
          Type 'unknown' is not assignable to type '(string | RegExp)[]'.

Our tracing setup is based on these instructions: https://docs.sentry.io/platforms/node/guides/express/#monitor-performance.

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