fix: convert jest.config-e2e from ESM to CJS to fix Node 24 Windows e2e#2306
Merged
Merged
Conversation
The .mjs extension forces Node's ESM loader which calls createCJSModuleWrap when wrapping ts-jest (a CJS module). On the updated windows-latest runner (git 2.53.0), Node 24 throws EBADF: bad file descriptor during this CJS wrap. Converting to .js (CJS by default, no "type": "module" in package.json) avoids the ESM/CJS interop layer entirely. Confirmed: same EBADF failure appears on Corentin's unrelated PR, showing this is a runner image regression not specific to any code change.
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1 task
Drarig29
approved these changes
May 5, 2026
1 task
Co-authored-by: Corentin Girard <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What and why?
After a
windows-latestrunner image update (git 2.54.0 → 2.53.0), two CI failures appeared on master:1. Windows e2e EBADF crash (all Node versions)
EBADF: bad file descriptor, fstatinnode:internal/modules/esm/translatorskilled jest before any tests ran. Root cause: the e2e project setup callsyarn set version stablewithout a.yarnrc.yml, so Yarn 4 defaults to PnP mode. PnP hooks into Node's ESM loader for module resolution, which callscreateCJSModuleWrapwhen loading CJS packages. On the updated runner, thisfstatcall fails with EBADF.Fix: write
nodeLinker: node-modulesinto.yarnrc.ymlafteryarn set version stableso the e2e project uses regularnode_modulesinstead of PnP.2. Windows Node 22 unit test crash
Jest workers crashed immediately on startup with "4 child process exceptions" when
NODE_OPTIONS: -r dd-trace/ci/initloaded[email protected]. Nodes 20 and 24 were unaffected. Upgrading to5.99.1resolves the incompatibility with the updated runner's Node 22.Both failures were reproducible on Corentin's unrelated PR, confirming they are runner regressions.
How?
.github/workflows/ci.yml: addecho "nodeLinker: node-modules" >> .yarnrc.ymlafteryarn set version stablein both e2e project setup steps (Linux and Windows)package.json: bumpdd-tracefrom5.72.0to5.99.1jest.config-e2e.mjs→jest.config-e2e.js: converted to CJS as belt-and-suspenders alongside the nodeLinker fixReview checklist