Skip to content

PnP: Stop using EDABF solution for Node 26.1.0+#7133

Merged
arcanis merged 2 commits into
masterfrom
clemyan/narrow-ebadf-gate
May 12, 2026
Merged

PnP: Stop using EDABF solution for Node 26.1.0+#7133
arcanis merged 2 commits into
masterfrom
clemyan/narrow-ebadf-gate

Conversation

@clemyan

@clemyan clemyan commented May 12, 2026

Copy link
Copy Markdown
Member

What's the problem this PR addresses?

Node 26.1.0 restored patchability of the fs module 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 the require global inside some CJS modules will only have some of the functionality, in particular it has no require.cache and require.extensions properties) 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

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

clemyan added 2 commits May 13, 2026 01:20
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
@clemyan clemyan changed the title PnP: Stop PnP: Stop using EDABF solution for Node 26.1.0+ May 12, 2026
@arcanis arcanis merged commit 4287909 into master May 12, 2026
26 of 27 checks passed
@arcanis arcanis deleted the clemyan/narrow-ebadf-gate branch May 12, 2026 18:29
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants