testing-library / jest-dom

:owl: Custom jest matchers to test the state of the DOM

Home Page:https://testing-library.com/docs/ecosystem-jest-dom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in experimental-vm-modules , got SyntaxError: The requested module '@jest/globals' does not provide an export named 'default'

jaredhan418 opened this issue · comments

  • @testing-library/jest-dom version: 6.1.2
  • node version: 18.16
  • npm (or yarn) version: 9.5.1

Relevant code or config:

// testing.setup.ts
import "@testing-library/jest-dom/jest-globals";

What you did:

I am running jest test by pure ESM mode, and setup jest.config.js by tutorial.

node --experimental-vm-modules node_modules/jest/bin/jest.js

All the things works good until upgrade to version 6.1.2

What happened:

I got jest import error

 SyntaxError: The requested module '@jest/globals' does not provide an export named 'default'

      at Runtime.linkAndEvaluateModule (node_modules/jest-runtime/build/index.js:708:5)

Reproduction:

截屏2023-08-28 13 04 36

just when jest-globals.msj start to import globals from '@jest/globals'; jest will throw error

Problem description:

Suggested solution:

🎉 This issue has been resolved in version 6.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀