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

my aws-sdk project dont work in VUE3+Vite #4638

Open
jy852095639 opened this issue May 21, 2024 · 4 comments
Open

my aws-sdk project dont work in VUE3+Vite #4638

jy852095639 opened this issue May 21, 2024 · 4 comments
Assignees
Labels
documentation This is a problem with documentation. response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@jy852095639
Copy link

Describe the issue

企业微信截图_17162877777521
node -v
17.0.0

vite
5.0.11

aws-sdk
2.1619.0

code:
import AWS from 'aws-sdk'
console.log(AWS)
When I introduce and use AWS, I will report an error

Links

NO

@jy852095639 jy852095639 added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels May 21, 2024
@aBurmeseDev
Copy link
Member

Hi @jy852095639 - thanks for reaching out.

Can you share your SDK code example that would give us more insight into the issue you're facing? Also it seems like you're using JavaScript SDK v2. If confirmed, I'll transfer this to our v2 repo.

Best,
John

@aBurmeseDev aBurmeseDev added 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 May 22, 2024
@jy852095639
Copy link
Author

import AWS from 'aws-sdk'
AWS.config.update({
accessKeyId: myAccessKeyId,
secretAccessKey: mySecretAccessKey,
region: myRegion
})
const s3 = new AWS.S3()
return s3.getSignedUrl('getObject', {
Bucket: bucket,
Key: url
})

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

Tookfreshman commented May 24, 2024

@jy852095639 in vite.config.ts, add this config maybe solve this problem

export default defineConfig({
build: {
commonjsOptions: {
strictRequires: true,
}
}
})

@aBurmeseDev aBurmeseDev self-assigned this Jun 10, 2024
@aBurmeseDev
Copy link
Member

@jy852095639 - appreciate for sharing the code. I don't see anything abnormal with the code.

Can you try updating Vite.config mentioned by @Tookfreshman (thanks for chiming in)?

@aBurmeseDev aBurmeseDev added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. 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

3 participants