Skip to content

7.1.3 introduced type error "Argument not assignable to parameter of type Context" #1585

@mdesousa

Description

@mdesousa

7.1.3 introduced an issue where a variable of type Context from aws-lambda cannot be used with middy handlers that use http-content-negotiation: "Type is missing the following properties from type '{ preferredCharsets: string[]; preferredCharset: string; preferredEncodings: string[]; preferredEncoding: string; preferredLanguages: string[]; preferredLanguage: string; preferredMediaTypes: string[]; preferredMediaType: string; }': preferredCharsets, preferredCharset, preferredEncodings, preferredEncoding, and 4 more."

To Reproduce

create a middy handler that uses http-content-negotiation and invoke it with an aws-lambda Context argument.

Expected behaviour
should build without error

Environment (please complete the following information):

  • Node.js: 24
  • Middy: 7.1.3
  • AWS SDK 3.1004.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions