aws-sdk-js doesn't work on sveltekit. #4530
Labels
bug
This issue is a bug.
investigating
Issue has been looked at and needs deep dive work by OSDS.
p2
This is a standard priority issue
Describe the bug
I want to use this sdk on sceltekit.
So I installed this sdk and import .svelte file.
But it doesn't work.
A error is appeared after I build and run it.
However, it runs correctly only debug in 'npm run dev`.
I think it's related to Vite.
I tried that it's written by this comment but it doesn't work.
#3673 (comment)
Expected Behavior
If I import aws-sdk, I can use aws-sdk on sveltekit.
Current Behavior
A error is appeared after I build and run it.
However, it runs only debug by 'npm run dev`.
However, it runs correctly only debug in 'npm run dev`.
I think it's related to Vite.
Reproduction Steps
node -v 18.16.0
create-svelte version 5.3.1
npm create svelte@latest [projectname]
◆ Select additional options (use arrow keys/space bar)
│ ◼ Add ESLint for code linting
│ ◼ Add Prettier for code formatting
│ ◼ Add Playwright for browser testing
│ ◼ Add Vitest for unit testing
run
npm install aws-sdk
in the projectimport the library in
routes/+page.svelte
file. like bellow.run
npm run build
run
npm run preview
After watch the localhost url , you can watch this issue
Possible Solution
I found this issue and I tried to change vite config and svelte config like bellow.
#3673
But it doesn't work.
svelte.config.js
vite.config.ts
Additional Information/Context
No response
SDK version used
"aws-sdk": "^2.1501.0"
Environment details (OS name and version, etc.)
node -v 18.16.0, create-svelte version 5.3.1, iOS 14.0
The text was updated successfully, but these errors were encountered: