PnP: Stop using EDABF solution for Node 26.1.0+#7133
Merged
Conversation
Node 26.1.0 restored patchability of the `fs` module inside the loader pipeline, making our EBADF solution obsolete (for now) This commit stops applying our EBADF solution for Node 26.1.0+, to avoid triggering the "synthetic `require`" behavior which breaks some packages when our EBADF solution is applied
3 tasks
arcanis
pushed a commit
that referenced
this pull request
Jun 1, 2026
<!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? Node backported nodejs/node#62835 restoring `fs` patchability, so we can now disable the same EBADF workaround for it. This follows the same pattern as #7133. ... ## How did you fix it? Changed the condition to only enable the workaround for node 24.15.x, as it is the only release with the issue. I tested the adjusted version works on 24.16.0. ... ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. (I used the same version bumps as #7133) <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
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's the problem this PR addresses?
Node 26.1.0 restored patchability of the
fsmodule inside the loader pipeline, making our EBADF solution obsolete (for now)Our EBADF solution isn't "free" either. It triggers the "synthetic
require" behavior (where therequireglobal inside some CJS modules will only have some of the functionality, in particular it has norequire.cacheandrequire.extensionsproperties) which breaks some packages. It's just better than completely breaking when using affected Node versions.How did you fix it?
Stops applying our EBADF solution for Node 26.1.0+
Checklist