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.2node
version: 18.16npm
(oryarn
) 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](https://private-user-images.githubusercontent.com/11781874/263598207-618958ec-f1dd-45f5-a0d9-064a45667162.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc3ODk4MTEsIm5iZiI6MTcxNzc4OTUxMSwicGF0aCI6Ii8xMTc4MTg3NC8yNjM1OTgyMDctNjE4OTU4ZWMtZjFkZC00NWY1LWEwZDktMDY0YTQ1NjY3MTYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA3VDE5NDUxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3ODc2YjExMjY4NGYzMWRiODhiMWI1YTgwNzhhMDE0OGQyYjk3ZGIxYzJjNjFmODg5OWEyNjg4NGQ5ZTgzZDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nhjkpJwP7h63wGTNUb9iPftS_Xig0eryAVFtP8Mb-pY)
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 📦🚀