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

TypeError: fromEnv is not a function #6006

Closed
3 tasks done
vs223 opened this issue Apr 17, 2024 · 2 comments
Closed
3 tasks done

TypeError: fromEnv is not a function #6006

vs223 opened this issue Apr 17, 2024 · 2 comments
Assignees
Labels
closed-for-staleness guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@vs223
Copy link

vs223 commented Apr 17, 2024

Checkboxes for prior research

Describe the bug

code: undefined, TypeError: fromEnv is not a function TypeError: fromEnv is not a function
        at _a (****/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js:71:16)
        at ****/node_modules/@smithy/property-provider/dist-cjs/index.js:79:27
        at coalesceProvider (****/node_modules/@smithy/property-provider/dist-cjs/index.js:106:18)
        at _SignatureV4S3Express.credentialProvider (****/node_modules/@smithy/property-provider/dist-cjs/index.js:124:18)
        at _SignatureV4S3Express.signRequest (****/node_modules/@smithy/signature-v4/dist-cjs/index.js:486:25)
        at ****/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js:223:21
        at ****/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38
        at ****/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js:173:18
        at ****/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:97:20
        at ****/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:120:14
        at ****/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:33:22
// package.json
{
  "dependencies": {
    "@aws-sdk/client-s3": "^3.554.0",
    "@aws-sdk/credential-providers": "^3.554.0",
    ...
  },
  ...
}

node version: v20.12.0

additional

after add yarn add @aws-sdk/credential-provider-env

`ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From test/app.e2e-spec.ts.`

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.12.0

Reproduction Steps

this.s3 = new S3(s3ClientConfig);
...
this.s3.getObject({ Bucket: this.bucket, Key: keys });

Observed Behavior

.

Expected Behavior

.

Possible Solution

x

Additional Information/Context

No response

@vs223 vs223 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 17, 2024
@RanVaknin
Copy link
Contributor

Hi @vs223 ,

code: undefined, TypeError: fromEnv is not a function TypeError: fromEnv is not a function

this suggest that the module was not installed. after you installed the dependency it seems like you are importing it after your jest E2E test has already been torn down.

The code snippet you shared is incomplete, and does not give us enough info to go off of.
Can you please better articulate the problem and include a more complete and concise code snippet?

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this Apr 22, 2024
@RanVaknin RanVaknin added guidance General information and guidance, answers to FAQs, or recommended best practices/resources. response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p3 This is a minor priority issue and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 22, 2024
Copy link

github-actions bot commented May 3, 2024

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels May 3, 2024
@github-actions github-actions bot closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance General information and guidance, answers to FAQs, or recommended best practices/resources. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants