Skip to content

[Bug]: import.meta.resolve behaves differently in Jest and Node #15313

Open

Description

Version

30.0.0-alpha.6

Steps to reproduce

Clone https://github.com/Kaciras/jest-bug-1 and install dependencies.

run

node index.test.js

run:

set NODE_OPTIONS=--experimental-vm-modules
jest

Expected behavior

Both commands should success.

Actual behavior

The command jest fail with error Cannot find module ...

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 5625U with Radeon Graphics
  Binaries:
    Node: 22.6.0 - D:\Program Files\NodeJS\node.EXE
    npm: 10.8.2 - D:\Program Files\NodeJS\npm.CMD
    pnpm: 9.10.0 - ~\AppData\Roaming\npm\pnpm.CMD
    bun: 1.1.27 - ~\.bun\bin\bun.EXE
  npmPackages:
    jest: ^30.0.0-alpha.6 => 30.0.0-alpha.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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