Closed hexinatgithub closed 3 months ago
Inject runtime solve the problem.
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
Use AWS SDK in browser, when
fromCognitoIdentityPool
is called, browser throw error.SDK version number
@aws-sdk/credential-providers@^3.600.0
Which JavaScript Runtime is this issue in?
Browser
Details of the browser/Node.js/ReactNative version
Edge/v20.14.0/^0.74.2
Reproduction Steps
I have code like above, when
uploader
function is called, error throwed.Observed Behavior
browser throw error:
Goto the
node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentityPool.js
file at line 11, vscode also show problem:Expected Behavior
Expect upload file to S3 bucket with credentials.
Possible Solution
It seems related to TypeScript
dynamic module Import
../loadCognitoIdentity
module not static bundle.Additional Information/Context
package.json