Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Jest crashes on Node.js v23 when using jest.config.js contains TLA #15363

Open
fisker opened this issue Oct 28, 2024 · 1 comment
Open

Comments

@fisker
Copy link
Contributor

fisker commented Oct 28, 2024

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
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant