sqs-consumer icon indicating copy to clipboard operation
sqs-consumer copied to clipboard

Aws-Sdk dependency error

Open kaanant opened this issue 4 years ago • 2 comments

Question I am currently using version "5.5.0", when I checked required dependencies and "aws-sdk" is devDependency. Here is my question. When I use this library without installing aws-sdk the following error occurs.

`Cannot find module 'aws-sdk/clients/sqs' from 'node_modules/sqs-consumer/dist/consumer.js'

  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
  at Object.<anonymous> (node_modules/sqs-consumer/dist/consumer.js:4:13)`

Could you please add aws-sdk as a dependency?

Additional context Also I need to install whole aws-sdk package. For example I only want to install sqs package of aws-sdk as @aws-sdk/client-sqs but this throws same error

kaanant avatar Mar 11 '21 10:03 kaanant

There really is no need to make the AWS-SDK a dependency when it can be installed with one command. As for the not including the entire SDK, you will need to include the entire SDK.

adamleemiller avatar Apr 10 '21 08:04 adamleemiller

This bit us yesterday. We removed the aws-sdk as a dependency from our application. When developing locally dev deps were installed and everything was working fine - on deploy to our stage environment the app suddenly crashes because sqs-consumer is missing aws-sdk. Sure, it was easy to install aws-sdk back again, but this is not what we expected.

noppaz avatar Jun 22 '21 07:06 noppaz

Sounds like it needs to be a peer dependency (sorry for the late reply, we're working on it ;) ).

nicholasgriffintn avatar Dec 08 '22 18:12 nicholasgriffintn

In the latest update, aws-sdk was moved to a dependency, it is believed that it was always meant to be here, it just wasn't for some reason as sqs-producer has aws-sdk in it's dependencies list already.

We do also require the dependency in the source code.

This will be in the package when we release 5.4.0 :)

nicholasgriffintn avatar Dec 09 '22 16:12 nicholasgriffintn