bbc / sqs-consumer

Build Amazon Simple Queue Service (SQS) based applications without the boilerplate
https://bbc.github.io/sqs-consumer/
Other
1.74k stars 333 forks source link

[Bug]: Types broken in latest version #338

Closed ChrisCates closed 1 year ago

ChrisCates commented 1 year ago

Describe the bug

.../node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
worker/process.ts:11:9 - error TS2739: Type 'SQS' is missing the following properties from type 'SQSClient': destroy, middlewareStack, send

11         sqs: SQS,
           ~~~

  node_modules/sqs-consumer/dist/consumer.d.ts:16:5
    16     sqs?: SQSClient;
           ~~~
    The expected type comes from property 'sqs' which is declared here on type 'ConsumerOptions'

Your minimal, reproducible example

...

Steps to reproduce

...

Expected behavior

...

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

...

Package version

...

AWS SDK version

No response

Additional context

Can you not have this ridiculous churn in your Github repos. It doesn't help and it turns me off so much, I'd rather just rewrite your library myself.

nicholasgriffintn commented 1 year ago

sqs-consumer now uses AWS SDK V3 and so the type for SQS has been changed to SQSClient, the error you provided is actually coming from code outside of sqs-consumer worker/process.ts:11:9.

I don't think there's an issue on our end here, if you prefer to use AWS SDK V2 then please use version 5.8.0.

ChrisCates commented 1 year ago

Got it thanks @nicholasgriffintn. I just noticed the README was updated.

Apologies for opening a redundant issue.

nicholasgriffintn commented 1 year ago

No problem, sorry it was not clearer for you.