question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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/credential-provider-cognito-identity@1.0.0-gamma.4 does not export ESM in the NPM published versionned. This issue is fixed from @aws-sdk/credential-provider-cognito-identity@1.0.0-gamma.6

Issue opened on @aws-sdk

To Reproduce

$ yarn add @aws-sdk/credential-provider-cognito-identity@1.0.0-gamma.4
$ ls node_modules/@aws-sdk/credential-provider-cognito-identity/dist
cjs
$ yarn add @aws-sdk/credential-provider-cognito-identity@1.0.0-gamma.6
$ 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
wlee221commented, Sep 10, 2020

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

2reactions
wlee221commented, Sep 10, 2020

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Few librairies are not published in esmodule #1476 - GitHub
When building a typescript application with a dependency on aws-amplify v3, there is a runtime exception when the library is calling a function ......
Read more >
AWS SDK for JavaScript v3
The AWS SDK for JavaScript v3 is a rewrite of v2 with some great new features. As with version 2, it enables you...
Read more >
AWS Lambda "cannot find module aws-sdk" in Build a Basic ...
In your code, you are trying to import AWS SDK v2. ... exports is not defined in ES module scope - the reason...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found