-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Closed
Copy link
Labels
Description
Version
30.0.0-alpha.6
Steps to reproduce
The jest.config.js
file in Prettier repo imports a module that contains TLA (comes from temp-dir
), when using Node.js v23 Jest crashes. prettier/prettier#16761
Expected behavior
Run tests without error.
Actual behavior
Error: require() cannot be used on an ESM graph with top-level await. Use import() instead. To see where the top-level await comes from, use --experimental-print-required-tla.
Additional context
I tried to comment out our install-prettier.js
Jest runs without error.
If I add
await Promise.resolve()
The error comes back.
Environment
System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
Node: 23.1.0 - ~\AppData\Local\fnm_multishells\1144_1730082443572\node.EXE
Yarn: 4.5.0 - D:\npm\yarn.CMD
npm: 10.9.0 - ~\AppData\Local\fnm_multishells\1144_1730082443572\npm.CMD
pnpm: 9.3.0 - D:\npm\pnpm.CMD
npmPackages:
jest: 30.0.0-alpha.6 => 30.0.0-alpha.6
blakeplumb, leaysgur, mxxk, Joredjs, Katsukiniwa and 5 more