Skip to content

Unexpected Typing issue for ExpressRequest using Koa #3137

Closed
@x20mar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions