Skip to content

error TS2345: Argument of type 'DeleteMessageCommand' is not assignable to parameter of type 'Command<ServiceInputTypes, DeleteMessageCommandInput, ServiceOutputTypes, ServiceOutputTypes, SmithyResolvedConfiguration<...>>'.TITLE FOR BUG REPORT #5641

@capaj

Description

@capaj

Checkboxes for prior research

Describe the bug

 error TS2345: Argument of type 'DeleteMessageCommand' is not assignable to parameter of type 'Command<ServiceInputTypes, DeleteMessageCommandInput, ServiceOutputTypes, ServiceOutputTypes, SmithyResolvedConfiguration<...>>'.
  The types of 'middlewareStack.concat' are incompatible between these types.
    Type '<InputType extends DeleteMessageCommandInput, OutputType extends DeleteMessageCommandOutput>(from: MiddlewareStack<InputType, OutputType>) => MiddlewareStack<...>' is not assignable to type '<InputType extends DeleteMessageCommandInput, OutputType extends ServiceOutputTypes>(from: MiddlewareStack<InputType, OutputType>) => MiddlewareStack<...>'.
      Types of parameters 'from' and 'from' are incompatible.
        Type 'MiddlewareStack<InputType, OutputType>' is not assignable to type 'MiddlewareStack<InputType, DeleteMessageCommandOutput>'.
          Types of property 'addRelativeTo' are incompatible.
            Type '(middleware: MiddlewareType<InputType, OutputType>, options: RelativeMiddlewareOptions) => void' is not assignable to type '(middleware: MiddlewareType<InputType, DeleteMessageCommandOutput>, options: RelativeMiddlewareOptions) => void'.
              Types of parameters 'middleware' and 'middleware' are incompatible.
                Type 'MiddlewareType<InputType, DeleteMessageCommandOutput>' is not assignable to type 'MiddlewareType<InputType, OutputType>'.
                  Type 'InitializeMiddleware<InputType, DeleteMessageCommandOutput>' is not assignable to type 'MiddlewareType<InputType, OutputType>'.
                    Type 'InitializeMiddleware<InputType, DeleteMessageCommandOutput>' is not assignable to type 'InitializeMiddleware<InputType, OutputType>'.
                      Call signature return types 'InitializeHandler<InputType, DeleteMessageCommandOutput>' and 'InitializeHandler<InputType, OutputType>' are incompatible.
                        Type 'Promise<InitializeHandlerOutput<DeleteMessageCommandOutput>>' is not assignable to type 'Promise<InitializeHandlerOutput<OutputType>>'.
                          Type 'InitializeHandlerOutput<DeleteMessageCommandOutput>' is not assignable to type 'InitializeHandlerOutput<OutputType>'.
                            Types of property 'output' are incompatible.
                              Type 'DeleteMessageCommandOutput' is not assignable to type 'OutputType'.
                                'DeleteMessageCommandOutput' is assignable to the constraint of type 'OutputType', but 'OutputType' could be instantiated with a different subtype of constraint 'ServiceOutputTypes'.

96           new DeleteMessageCommand({
             ~~~~~~~~~~~~~~~~~~~~~~~~~~
97             QueueUrl: envVars.SQS_NOTIFICATIONS_URL,
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98             ReceiptHandle: record.receiptHandle
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99           })
   ~~~~~~~~~~~~


Found 1 error in functions/notifications.ts:96

SDK version number

"@aws-sdk/client-sqs": "^3.485.0",

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

does not matter

Reproduction Steps

    await sqsClient.send(
      // we need to delete the message from the queue after we process it to avoid duplicate emails when lambda fails with a batch
      new DeleteMessageCommand({
        QueueUrl: envVars.SQS_NOTIFICATIONS_URL,
        ReceiptHandle: record.receiptHandle
      })
    )

Observed Behavior

type error is raised by TS compiler

Expected Behavior

no type error is raised by TS compiler

Possible Solution

downgrading to previous release

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p3This is a minor priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions