Version
30.4.1
Steps to reproduce
- Have a project with
"type": "module" and --experimental-vm-modules
- Depend on a package that sets
module.exports to a function or class
One exemple is ioredis@v5.10.1. Just add a test file with the following:
import { Redis } from 'ioredis';
Expected behavior
import { Redis } from 'ioredis' should've been resolved correctly.
Actual behavior
SyntaxError: The requested module 'ioredis' does not provide an export named 'Redis'
at EsmLoader.tryLoadGraphSync (node_modules/jest-runtime/build/index.js:725:18)
Additional context
It seems similar to #16144, but sufficiently different for me to open a new issue. If it's deemed as duplicate, please, let me know.
Reproduction: https://github.com/paemuri/jest-ioredis-repro
Environment
System:
OS: macOS 26.4.1
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 24.15.0
npm: 11.14.0
Version
30.4.1
Steps to reproduce
"type": "module"and--experimental-vm-modulesmodule.exportsto a function or classOne exemple is
ioredis@v5.10.1. Just add a test file with the following:Expected behavior
import { Redis } from 'ioredis'should've been resolved correctly.Actual behavior
Additional context
It seems similar to #16144, but sufficiently different for me to open a new issue. If it's deemed as duplicate, please, let me know.
Reproduction: https://github.com/paemuri/jest-ioredis-repro
Environment