Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
Czechh opened this issue Sep 17, 2021 · 6 comments
Closed
1 task done

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

Czechh opened this issue Sep 17, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Czechh
Copy link

Czechh commented Sep 17, 2021

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:
    • "@aws-sdk/client-ssm": "3.26.0"
@Czechh Czechh added the bug Something isn't working label Sep 17, 2021
@m-radzikowski
Copy link
Owner

Thank you for reporting this. The @aws-sdk/client-s3 should be an optional dependency, while in fact, the code requesting it is being always imported and causing this problem. I will try to fix this ASAP.

@m-radzikowski
Copy link
Owner

Fixed in #51 and released in v0.5.5.

@Kelvijn
Copy link

Kelvijn commented 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>;

@m-radzikowski
Copy link
Owner

@Kelvijn please provide a repo with reproduction.

@Ey-Jay
Copy link

Ey-Jay commented Apr 12, 2022

@m-radzikowski This is still an issue for me as well. I get the same error as @Kelvijn

Node version: Node 16.X
Typescript version: 4.6.3
AWS SDK v3 Client mock version: 0.6.2
AWS JS SDK libs and versions:
"@aws-sdk/client-sts": "3.67.0"

@m-radzikowski
Copy link
Owner

@Ey-Jay please provide a repo with reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants