-
Notifications
You must be signed in to change notification settings - Fork 600
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/credential-provider-process'
for S3 and SNS clients.
#4264
Comments
Cannot find module '@aws-sdk/credential-provider-process'
for S3 and SNS clients.'@aws-sdk/credential-provider-process'
for S3 and SNS clients.
I'm not sure why you are running into this. Your repro code is missing your config, so maybe you have an issue there? const { SQS, ListQueuesCommand } = require( '@aws-sdk/client-sqs' );
const client = new SQS( {region: "us-east-1"} );
async function run(){
try {
const data = await client.send(new ListQueuesCommand({}))
console.log(data)
} catch (error) {
console.log(error)
}
}
run() Output: {
'$metadata': {
httpStatusCode: 200,
requestId: 'REDACTED',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
NextToken: undefined,
QueueUrls: [ 'https://sqs.us-east-1.amazonaws.com/REDACTED/test-queue' ]
} That cognito error does not seem related to what you are describing.
Let me know that helps at all, Thanks, |
Hello,
|
Same issue with Referring to the package above, triggers an error: Error: Cannot find module '@aws-sdk/credential-provider-process'
Require stack:
- .../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProcessCredentials.js
- .../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js
- .../node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js
...and unrelated stack afterwards |
Can you please write some repro steps? before I can reproduce what you are experiencing I can't do anything on my end. Thanks, |
I got the described error both on the local machine as well as on the CI pipeline. I use pnpm 6.10.3 for installing packages. The package I develop uses the following prod dependencies: "@aws-sdk/client-sns": "3.186.0",
"@aws-sdk/client-sqs": "3.186.0",
"@aws-sdk/client-s3": "3.186.0",
"@aws-sdk/node-http-handler": "3.186.0", I have updated packages to: "@aws-sdk/client-s3": "3.229.0",
"@aws-sdk/client-sns": "3.229.0",
"@aws-sdk/client-sqs": "3.229.0",
"@aws-sdk/node-http-handler": "3.226.0", and the error message has been changed:
In the affected file, clients are initialized as follows: import { S3 } from '@aws-sdk/client-s3';
import { SQS, CreateQueueResult } from '@aws-sdk/client-sqs';
// ...
console.log('test1')
const s3 = new S3(
{
endpoint: 'http://localhost:4570',
region: 'eu-west-1',
credentials: {
accessKeyId: 'accesskey',
secretAccessKey: 'secretkey'
},
forcePathStyle: true
}
);
console.log('test2')
const sqs = new SQS(
{
endpoint: 'http://localhost:4576',
region: 'eu-west-1',
credentials: {
accessKeyId: 'accesskey',
secretAccessKey: 'secretkey'
}
}
);
console.log('test3') When I put a few console logs, none of the placed console logs were shown so it seems it fails before initializing clients. Changing imports to |
PNPM is proposing a workaround by the way: PNPM/packageExtensions |
I still can't seem to reproduce. I've tried both with pnpm and npm, require and imports. Not sure why you are running into this.. any other reproduction info you could provide? node version you are using? Vanilla JS or TS? any other info? Thanks, |
The issue was reproducible both on Node 18 and 16, I use TS and CommonJS approach. |
Can you please create a minimal repo for reproduction? Thanks, |
This should be resolved by #4302. |
@mhassan1 I can confirm #4302 resolved the issue, thank you for your help! I close the issue as completed. Also @RanVaknin thanks for your involvement. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Checkboxes for prior research
Describe the bug
I try to upgrade @AWS-SDK packages from
3.188.0
to3.226.0
and as up to3.224.0
I encountered issue from #4075, running clients from3.226.0
causes that a different message is emitted:I've tried to install
@aws-sdk/credential-providers
but it did not resolve the issue. The issue can be resolved by installing@aws-sdk/credential-provider-process
but the docs says clearly:So I believe it is not an intentional flow.
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
16.13.1 but the same happens on Node 18
Reproduction Steps
Just initialize a SQS client
Observed Behavior
Expected Behavior
As before
3.188.0
it was possible to use clients without additional credential packages I believe that including required libs is expected. If the lib cannot be included in the client packages, then adding@aws-sdk/credential-providers
should resolve the issue.Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: