-
Notifications
You must be signed in to change notification settings - Fork 634
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
I am using TypeScript and try to import from @aws-sdk/client-s3 in my Vitest tests. While trying to run the test, I got the error
Cannot find module '/Users/xxx/workspace/xxx/node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/core/dist-es/submodules/client/index' imported from /Users/xxx/workspace/xxx/node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/core/dist-es/index.js
.
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?
Node.js
Details of the browser/Node.js/ReactNative version
v22.13.0
Reproduction Steps
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
Observed Behavior
Error: Cannot find module '/Users/xxx/workspace/xxx/node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/core/dist-es/submodules/client/index' imported from /Users/xxx/workspace/xxx/node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/core/dist-es/index.js
Expected Behavior
Successfully import the classes
Possible Solution
No response
Additional Information/Context
Typescript: v5.7.3
Vite: v3.0.0
Vitest: v6.0.7
pnpm: v10.0.0
// tsconfig.json
"module": "esnext",
"moduleResolution": "bundler",
// package.json
"type": "module",