Skip to content

S3 Client Module Resolution Issue #6815

@CHC383

Description

@CHC383

Checkboxes for prior research

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",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions