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

@aws-sdk/client-cognito-identity package dependencies do not build in vite #6705

Closed
3 of 4 tasks
radiantone opened this issue Dec 1, 2024 · 3 comments
Closed
3 of 4 tasks
Assignees
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@radiantone
Copy link

radiantone commented Dec 1, 2024

Checkboxes for prior research

Describe the bug

Error

'request' is not exported by __vite-browser-external, imported by node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
file: /home/darren/git/va/visualagents/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js:3:9
1: import { ProviderError } from "@smithy/property-provider";
2: import { Buffer } from "buffer";
3: import { request } from "http";
            ^
4: export function httpRequest(options) {
5:     return new Promise((resolve, reject) => {
Error: 'request' is not exported by __vite-browser-external, imported by node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js

package-lock.json

"node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/credential-provider-ini": {
      "version": "3.699.0",
      "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.699.0.tgz",
      "integrity": "sha512-dXmCqjJnKmG37Q+nLjPVu22mNkrGHY8hYoOt3Jo9R2zr5MYV7s/NHsCHr+7E+BZ+tfZYLRPeB1wkpTeHiEcdRw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@aws-sdk/core": "3.696.0",
        "@aws-sdk/credential-provider-env": "3.696.0",
        "@aws-sdk/credential-provider-http": "3.696.0",
        "@aws-sdk/credential-provider-process": "3.696.0",
        "@aws-sdk/credential-provider-sso": "3.699.0",
        "@aws-sdk/credential-provider-web-identity": "3.696.0",
        "@aws-sdk/types": "3.696.0",
        "@smithy/credential-provider-imds": "^3.2.6",
        "@smithy/property-provider": "^3.1.9",
        "@smithy/shared-ini-file-loader": "^3.1.10",
        "@smithy/types": "^3.7.1",
        "tslib": "^2.6.2"
      },

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

vite/2.9.18 linux-x64 node-v20.14.0

Reproduction Steps

$ quasar build -m pwa

in my project folder, which builds my VueJS webapp using Vite.

Observed Behavior

Error shown in description

Expected Behavior

No errors

Possible Solution

force a package version for 'http' maybe?

Additional Information/Context

No response

@radiantone radiantone added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 1, 2024
@zshzbh
Copy link
Contributor

zshzbh commented Dec 4, 2024

Hey @radiantone
Could you please provide your minimal code reproduction?

@zshzbh zshzbh self-assigned this Dec 4, 2024
@zshzbh zshzbh added p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Dec 4, 2024
@zshzbh
Copy link
Contributor

zshzbh commented Dec 4, 2024

Hey @radiantone ,

imds is the instance metadata service and browsers do not have instance metadata, which this indicates that the build step did not correctly set the build environment to "browser" mode

in browser mode, client-cognito-identity/runtimeConfig.ts is replaced by runtimeConfig.browse.ts

Could you please re-configure the project to use runtimeConfig.browse.ts and let us know if the issue still exists?

Thanks!

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Dec 5, 2024
@zshzbh zshzbh added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Dec 5, 2024
Copy link

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 github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants