Amplify-js: @aws-sdk v1.0.0-gamma.4 does not export ESM

Created on 29 Aug 2020  路  7Comments  路  Source: aws-amplify/amplify-js

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]

Issue opened on @aws-sdk

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

Build Core

Most helpful comment

The fix is now released. Thanks for bringing this to our attention 馃憤

All 7 comments

@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.

Hello @superCarton and @shox-harri, this is fixed in #6748 and is now published on unstable npm tag. We will update you once it gets released to latest -- meanwhile, please feel free to use aws-amplify@unstable to unblock yourself, thanks!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simon998yang picture simon998yang  路  3Comments

callmekatootie picture callmekatootie  路  3Comments

guanzo picture guanzo  路  3Comments

TheRealRed7 picture TheRealRed7  路  3Comments

epicfaace picture epicfaace  路  3Comments