Skip to content

[Bug]: Jest v30: setupFilesAfterEnv fails with mounted volume path (unrs-resolver unsupported construct) #15923

@just-small-potato

Description

@just-small-potato

Version

30.0.2

Steps to reproduce

After upgrading from Jest v29 to v30 in my restricted corporate environment - Virtual Machine with user directory as mounted volume, tests fail to load @testing-library/jest-dom even though it is installed. Jest throws a validation error on configuration file:

Module @testing-library/jest-dom in the setupFilesAfterEnv option was not found.

This only started happening after upgrading to v30.

After looking in to the source code, it seems that there is an error coming out from the unrs-resolver, which tries to resolve mounted volume with a path starting with \\?:

Error: Path "\\?\Volume{c79c005d-0000-0000-0000-100000000000}\" contains unsupported construct.

Image Image Image

Expected behavior

Jest should be able to resolve node_modules or files on mounted volumes.

Actual behavior

Jest throws a validation error on configuration file:

Module @testing-library/jest-dom in the setupFilesAfterEnv option was not found.

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.17763
    CPU: (32) x64 Intel(R) Xeon(R) Gold 6240R CPU @ 2.40GHz
  Binaries:
    Node: 18.20.8 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Users\vmuser\AppData\Roaming\npm\yarn.CMD
    npm: 10.8.2 - D:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^30.2.0 => 30.2.0

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