Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix importing node-only modules in browser env #2491

Closed
wants to merge 13 commits into from

Conversation

klarkc
Copy link

@klarkc klarkc commented Jun 15, 2021

Issue

#2478

Description

Fix not being able to import @aws-sdk/credential-provider-cognito-identity and @aws-sdk/client-cognito-identity in vite-project

Testing

cd tests/vite-project
yarn install
yarn build

Additional context

I've detected that package.json browser runtimeConfig entry in @aws-sdk/client-cognito-identity was pointing to the typescript source file, but the built file was missing, so I fixed it.

Also, I moved node-only code of @aws-sdk/credential-provider-web-identity into @aws-sdk/credential-provider-node-identity.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@klarkc
Copy link
Author

klarkc commented Jun 15, 2021

There are more incorrect runtimeConfig configs in the clients packages, but I fixed only the few that was blocking me of using cognito sdk

@klarkc klarkc requested a review from a team as a code owner January 28, 2022 23:34
@klarkc klarkc mentioned this pull request Mar 14, 2022
@dancingfrog
Copy link

This is definitely the problem...

I have determined that the following modules cause build errors related to expecting various node js modules in the browser such as http and fs.

        '@aws-sdk/credential-provider-imds',
        '@aws-sdk/credential-provider-process',
        '@aws-sdk/shared-ini-file-loader',
        '@aws-sdk/eventstream-serde-node',
        '@aws-sdk/hash-node',
        '@aws-sdk/node-http-handler',
        '@aws-sdk/util-body-length-node',
        '@aws-sdk/util-user-agent-node',

Hopefully the sdk team jumps on this in the nearish future!

Originally posted by @dancingfrog in aws-amplify/amplify-js#9639 (comment)

@LorhanSohaky
Copy link

@trivikr , can you review?

@trivikr
Copy link
Member

trivikr commented Aug 9, 2023

The issue in #2478 was resolved after detailed discussions.

The TODO here is to create a new specific bug report, if the issue continue exists. If it doesn't, close the PR.

@trivikr trivikr self-assigned this Aug 9, 2023
@RanVaknin
Copy link
Contributor

Hello everyone on the thread.
Since there was no bug report created for this PR per @trivikr instructions, and this PR was opened in 2021, I feel confident we can close this.

Thank you again for your contribution.
All the best,
Ran~

@RanVaknin RanVaknin closed this Nov 28, 2023
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants