You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests run using: NODE_OPTIONS=--experimental-vm-modules npx jest --run-in-band --verbose --ci
Error log:
/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:841
const error = new Error(
^
Error: Must use import to load ES Module: /home/runner/work/my-project/my-project/node_modules/undici/lib/llhttp/llhttp.wasm
at Runtime.requireModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:841:21)
at Runtime.requireModuleOrMock (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1039:21)
at lazyllhttp (/home/runner/work/my-project/my-project/node_modules/undici/lib/client.js:362:55)
at Object.<anonymous> (/home/runner/work/my-project/my-project/node_modules/undici/lib/client.js:424:21)
at Runtime._execModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1429:24)
at Runtime._loadModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1013:12)
at Runtime.requireModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:873:12)
at Runtime.requireModuleOrMock (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1039:21)
at Object.<anonymous> (/home/runner/work/my-project/my-project/node_modules/undici/index.js:3:16)
at Runtime._execModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1429:24)
at Runtime._loadModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1013:12)
at Runtime.requireModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:873:12)
at Runtime.requireModuleOrMock (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:1039:21)
at Runtime.loadCjsAsEsm (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:717:22)
at Runtime.resolveModule (/home/runner/work/my-project/my-project/node_modules/jest-runtime/build/index.js:675:17)
at ModuleWrap.<anonymous> (node:internal/vm/module:306:24) {
code: 'ERR_REQUIRE_ESM'
Bug Description
Error when loading undici into jest unit tests
Logs
Tests run using:
NODE_OPTIONS=--experimental-vm-modules npx jest --run-in-band --verbose --ci
Error log:
Environment
NodeJS: 18.15.0
Jest: 29.5.0
ts-jest: 29.0.5
ts-node: 10.9.1
typescript: 4.9.5
undici: 5.21.2
Jest config:
TS config:
Additional context
Error appears on undici v5.16.0
Possibly comes from : d0a99c2
The text was updated successfully, but these errors were encountered: