question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module '@aws-sdk/client-s3'

See original GitHub issue

Checklist

  • I have read Caveats documentation and didn’t find a solution for this problem there.

Bug description On version 0.5.3 my tests were running successfully, but after the latest change I’m getting a module error for ‘@aws-sdk/client-s3’. This is issue started for me on 0.5.4 - I reverted back to the previous version and it’s working again as expected.

I don’t use @aws-sdk/client-s3 at all in my application/test code.

Error: Cannot find module '@aws-sdk/client-s3'
Require stack:
- /home/circleci/libs/node_modules/aws-sdk-client-mock/dist/cjs/libStorage.js
- /home/circleci/libs/node_modules/aws-sdk-client-mock/dist/cjs/index.js
- /home/circleci/libs/packages/lib-param-store/test/index_test.js
- /home/circleci/libs/node_modules/mocha/lib/esm-utils.js
- /home/circleci/libs/node_modules/mocha/lib/mocha.js
- /home/circleci/libs/node_modules/mocha/lib/cli/one-and-dones.js
- /home/circleci/libs/node_modules/mocha/lib/cli/options.js
- /home/circleci/libs/node_modules/mocha/lib/cli/cli.js
- /home/circleci/libs/node_modules/mocha/lib/cli/index.js
- /home/circleci/libs/node_modules/mocha/bin/_mocha

Environment

  • Node version: Node 14.X
  • Typescript version: Javascript
  • AWS SDK v3 Client mock version: 0.5.4
  • AWS JS SDK libs and versions:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Kelvijncommented, Dec 29, 2021

@m-radzikowski this is still an issue for me on all versions mentioned here except v0.5.3:/

node_modules/aws-sdk-client-mock/dist/types/libStorage.d.ts:8:95 - error TS2307: Cannot find module '@aws-sdk/client-s3' or its corresponding type declarations.

8 export declare const mockLibStorageUpload: (s3Mock?: import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes> | undefined) => import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes>;
                                                                                                ~~~~~~~~~~~~~~~~~~~~

node_modules/aws-sdk-client-mock/dist/types/libStorage.d.ts:8:143 - error TS2307: Cannot find module '@aws-sdk/client-s3' or its corresponding type declarations.

8 export declare const mockLibStorageUpload: (s3Mock?: import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes> | undefined) => import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes>;
                                                                                                                                                ~~~~~~~~~~~~~~~~~~~~

node_modules/aws-sdk-client-mock/dist/types/libStorage.d.ts:8:242 - error TS2307: Cannot find module '@aws-sdk/client-s3' or its corresponding type declarations.

8 export declare const mockLibStorageUpload: (s3Mock?: import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes> | undefined) => import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes>;
                                                                                                                                                                                                                                                   ~~~~~~~~~~~~~~~~~~~~

node_modules/aws-sdk-client-mock/dist/types/libStorage.d.ts:8:290 - error TS2307: Cannot find module '@aws-sdk/client-s3' or its corresponding type declarations.

8 export declare const mockLibStorageUpload: (s3Mock?: import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes> | undefined) => import("./awsClientStub").AwsStub<import("@aws-sdk/client-s3").ServiceInputTypes, import("@aws-sdk/client-s3").ServiceOutputTypes>;

1reaction
m-radzikowskicommented, Sep 19, 2021

Fixed in #51 and released in v0.5.5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module '@aws-sdk/client-sns' - Stack Overflow
I ran into a similar problem using AWS Layers and ES modules. Using the absolute specifier for the import ...
Read more >
@aws-sdk/client-s3 - npm
AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native. Latest version: 3.238.0, last published: 3 days ago.
Read more >
3.192.0 introduces breaking change: Cannot find module ...
Just install @aws-sdk/client-s3@3.192.0 and you will be able to reproduce ... Error: Cannot find module '@aws-sdk/util-endpoints' Require ...
Read more >
S3 Client - AWS SDK for JavaScript v3
The AWS SDK is modulized by clients and commands. To send a request, you only need to import the S3Client and the commands...
Read more >
Failed to upload image to S3: FunctionError: Cannot find ...
When trying to aquire the aws-sdk i'm recieving the aforementioned error in title. Do i need to import a package or namespace or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found