ssut / nestjs-sqs

A project to make SQS easier to use within NestJS, with decorator-based handling and seamless NestJS-way integration.
MIT License
204 stars 54 forks source link

TypeError: Cannot read properties of undefined (reading 'map') #72

Open krsaedan opened 10 months ago

krsaedan commented 10 months ago

Hello, currently, I have the following error when trying to send messages: "Cannot read properties of undefined (reading 'map')" when executing "this.sqsService.send".

The configuration is as follows:

"@ssut/nestjs-sqs": "^1.2.0", "aws-sdk": "^2.1488.0",

the error is intermittent

Noezor commented 10 months ago

Getting the same issue and using the same library. Are you sure it's from the library? The intermittence of the issue is weird.

gabriel-skinny commented 10 months ago

Happining the same here. Started intermittent, but now every time i call this method it returns the same error. I think it is probally the version that im using (1.0.1), because what is causing the error is in the line 48 of producer.js, and this part of the code only treats the return of the sqs message. I think they changed the return and the old versions are not working.

gabriel-skinny commented 10 months ago

Yep, its seems that is it. The aws-sdk changed the return of the sendMessageBatch function, and does not return the object of failure. In the newest version of sqs-producer, they changed the treatment, but in the old ones are not working. One solution is to downgrade aws-sdk to the version 2.1490.

There is already an issue open on the aws-sdk repository: https://github.com/aws/aws-sdk/issues/657.

Noezor commented 10 months ago

I think we can close as not related to this library ?

sildar commented 10 months ago

I believe the issue is with the version of sqs-producer that is used, as the last version of that library does check for undefined.