Skip to content

Unexpected Typing issue for ExpressRequest using Koa #3137

Description

@x20mar

Package + Version

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

Version:

5.29.2

Description

When using Koa as your HTTP server, you get an unexpected typing error stating that a Koa request is not assignable to ExpressRequest

function logError(ctx: ParameterizedContext, err?: any): void {
    Sentry.withScope(function (scope) {
        scope.addEventProcessor(function (event) {
          return Sentry.Handlers.parseRequest(event, ctx.request);
        });
        Sentry.captureException(err);
      });
}
Argument of type 'Request' is not assignable to parameter of type 'ExpressRequest'.
  Type 'Request' is missing the following properties from type 'ExpressRequest': aborted, httpVersion, httpVersionMajor, httpVersionMinor, and 40 more.

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