aws-sdk-js-v3 icon indicating copy to clipboard operation
aws-sdk-js-v3 copied to clipboard

module does not provide an export named 'fromSSO'

Open alenocera opened this issue 1 year ago • 8 comments

Checkboxes for prior research

Describe the bug

Hi, I'm using vite 5.0.11 and I'm trying to use retrieve credentials using fromSSO approach but the following issue appears: The requested module '/node_modules/.vite/deps/@aws-sdk_credential-providers.js?v=4d2ccf96' does not provide an export named 'fromSSO'.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

20.10.0

Reproduction Steps

import { fromSSO } from '@aws-sdk/credential-providers';
const credentials = await fromSSO({
  profile: '<my-profile>'
})();
const client = new S3Client({
  region: 'us-east-1',
  credentials,
});

Observed Behavior

Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/@aws-sdk_credential-providers.js?v=4d2ccf96' does not provide an export named 'fromSSO' at

Expected Behavior

My credentials are retrieved correctly in according with the SDK documentation.

Possible Solution

No response

Additional Information/Context

No response

alenocera avatar Jan 19 '24 16:01 alenocera

Hi, sorry for this bug. We will release a fix for this today. Same root cause: https://github.com/aws/aws-sdk-js-v3/issues/5692

It is due to incomplete export annotations in the latest build.

kuhe avatar Jan 19 '24 17:01 kuhe

Actually, I'm having trouble reproducing this on 3.495.0. ~What version of the SDK packages do you have?~

Can you show your build configuration and build commands?

kuhe avatar Jan 19 '24 19:01 kuhe

I didn't reproduce it, but, this release should address the issue: https://www.npmjs.com/package/@aws-sdk/credential-providers/v/3.496.0

kuhe avatar Jan 19 '24 20:01 kuhe

Hi kuhe, thanks for the update. At the first touch seems that passing through the backend with the 3.496.0 the credentials are correctly retrieved, instead using FE side, nope. Anyway somehow using BE it is not a problem, my side. So, what do you mean for "build commands"? I mean, I'm using the classical vite build with npm, with no special things.

alenocera avatar Jan 22 '24 08:01 alenocera

What are the reproduction steps and error for the front end issue you are referring to?

kuhe avatar Jan 22 '24 14:01 kuhe

Some as the first post. I've just updated the package with the last version released and into the console I received the same error:

Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/@aws-sdk_credential-providers.js?v=4d2ccf96' does not provide an export named 'fromSSO' at

Just import the lib, then set the configuration like the profile (sso) as defined into my local machine using the CLI tool and that's.

Sounds strange because passing through the BE this issue not appears (my BE developer tell me this).

alenocera avatar Jan 22 '24 14:01 alenocera

is this still affecting vite builds as of v3.515.0 or later?

kuhe avatar Feb 23 '24 19:02 kuhe

yes it seems like this is still failing on 3.523.0

jcramb avatar Feb 28 '24 07:02 jcramb

any update on this? i am experiencing the exact same issue as alenocera@ where the BE calls work but not from a react FE

githubb404 avatar Mar 04 '24 18:03 githubb404

The original reported issue says it's for Node.js. fromSSO is not available in the browser https://www.npmjs.com/package/@aws-sdk/credential-providers#fromsso.

What are you trying to do with the application? Could you create a minimal reproduction example repository?

kuhe avatar Mar 05 '24 19:03 kuhe

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] avatar Mar 16 '24 00:03 github-actions[bot]

Our side we use it through the BE as I told in the previous message. As I far know, with my teammates we doesn't care about using it through the FE anymore, so we stopped our development by using it in this way. Maybe @githubb404 expected some news, I don't know....we can rely on his reply.

alenocera avatar Mar 18 '24 08:03 alenocera

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] avatar Mar 29 '24 00:03 github-actions[bot]

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.

github-actions[bot] avatar Apr 16 '24 00:04 github-actions[bot]