I am trying to replace S3 aws-sdk v2 with @aws-sdk/client-s3 v3 (The guide I am using). This was working with v2 (putObject, getObject, etc.), but with the changes, I am getting an error saying:
ERROR Error: Uncaught (in promise): Error: Credentialis missing Error: Credentialis missing
This error happens upon load, I am not even calling any of the methods, just initializing the S3 object.
private readonly s3 = new S3({
region: environment.AWS.region,
credentials: fromCognitoIdentityPool({
client: new CognitoIdentityClient({ region: environment.AWS.region }),
identityPoolId: environment.AWS.identityPoolId
})
})