Describe the bug
In an ESM application using aws-amplify library 3.4.6, we encounter a runtime issue when the library is calling functions on @aws-sdk/credential-provider-cognito-identity.
Eg. of javascript runtime issue when calling :
object(...) is not a function
In my case, it was breaking on the following line which was generating a login issue during the oauth step.
After investigation, @aws-sdk/[email protected] does not export ESM in the NPM published versionned. This issue is fixed from @aws-sdk/[email protected]
To Reproduce
$ yarn add @aws-sdk/[email protected]
$ ls node_modules/@aws-sdk/credential-provider-cognito-identity/dist
cjs
$ yarn add @aws-sdk/[email protected]
$ ls node_modules/@aws-sdk/credential-provider-cognito-identity/dist
cjs es
Expected behavior
All aws-sdk packages should export ESM
Additional context
Happens on all browsers.
Suggested fix
Bump @aws-sdk packages dependencies to v1.0.0-gamma.6 or higher
@superCarton Thanks for reporting this, We are aware of the export to ESM is not being export because of gamma.4
version. We are working on testing the later version, gamma.8
in order to validate non breaking changes in order to get this issue fixed. I will provide another update later on in the week. Thanks!
@superCarton ETA next week in getting a deployment out for this. Just wanted to provide another update.
The fix is now released. Thanks for bringing this to our attention 馃憤
Thanks a lot for your help @wlee221 @sammartinez
Thanks for reporting this @superCarton !! Always happy to help
Many thanks @sammartinez and @wlee221 for the super fast fix I really appreciate it.
Most helpful comment
The fix is now released. Thanks for bringing this to our attention 馃憤