Skip to content

Module resolution regression in v3 #7269

@vladkrasn

Description

@vladkrasn

Describe the bug

Writing a test that involves an import from @aws-sdk/client-s3 causes errors like:

Cannot find module 'C:\Users\<path-to-folder>\vitest-3-regression\node_modules\@aws-sdk\core\dist-es\submodules\client\index' imported from C:\Users\<path-to-folder>\node_modules\@aws-sdk\core\dist-es\index.js

Reproduction

https://github.com/vladkrasn/vitest-3-regression

npm install
npm run test

Produces the errors.

Switching to v2 using

npm install vitest@2

fixes the issue

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 AMD Ryzen 7 9800X3D 8-Core Processor
    Memory: 4.19 GB / 31.10 GB
  Binaries:
    Node: 22.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.10.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (129.0.2792.65)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    vitest: ^3.0.0 => 3.0.0

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions