-
Notifications
You must be signed in to change notification settings - Fork 13
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
Node 22.12.0 incompatible with jest #3871
Comments
Can you please describe the impact of this issue?
Pinning is only a temporary solution to the problem since as you point out, we are already using this version of node. Unless the p |
If the CI runners begin using node v22.12.0 as the default node 20 version, all jest test commands will then fail with this error: |
For some reason node 22.12.0 won't allow top level awaits with the jest config. I've updated the jest configs to not use a top level await and it fixes the issue: New jest config in all the packages
|
This was not actually related to prettier at all. |
After removing top level awaits from the |
I figured out why we were having issues with |
This PR makes the following changes: - In `jest.config.base.js` explicitly set `transformIgnorePatterns` to the default (`['/node_modules/', '\\.pnp\\.[^\\/]+$']`), which will skip running transforms on node-modules or pnp files. We were overriding the default with an empty array. Standard practice is to only transform specific dependencies if there is a need. - Remove patch for `unicorn-magic` dependency, as it is no longer being broken by the jest transform. - Add README to `./patches` explaining how to make a patch using `patch-package`. This also prevents the `patches` directory from being removed if there are no patches, breaking the docker build. Ref: #3871, #3874
jestjs/jest#15363
prettier/prettier#16930
If I am reading these issues correctly, it looks like
jest.config.ts
will fail when it tries to import a package that importsprettier
if running node v22.12.0 or v23.xlucene-parser
hasprettier
as a nested dependency.We need to pin node 22 at
22.11.0
in CI before github starts using node 22.12.0.The base-docker-image already contains node 22.12.0 and It is used in teraslice v2.9.1 and v2.9.2. I will test to see if I can find any issues with how these versions function.
The text was updated successfully, but these errors were encountered: