Skip to content

PnP: Include Node 22.22.3 in fstat workaround#7141

Merged
arcanis merged 3 commits into
yarnpkg:masterfrom
junjuny0227:fix-node-22-fstat-gate
May 21, 2026
Merged

PnP: Include Node 22.22.3 in fstat workaround#7141
arcanis merged 3 commits into
yarnpkg:masterfrom
junjuny0227:fix-node-22-fstat-gate

Conversation

@junjuny0227
Copy link
Copy Markdown
Contributor

What's the problem this PR addresses?

Closes #7140.

The HAS_BROKEN_FSTAT_FOR_ZIP_FDS gate didn't include the Node v22.22.3 release line, even though the same ESM/module loader regression that affected newer Node releases was backported
there.

This causes Yarn PnP's ESM loader to miss the fstat workaround on Node v22.22.3+, leading to EBADF: bad file descriptor, fstat when loading CJS files from zip archives.

How did you fix it?

The Node version parsing now includes the patch version, and HAS_BROKEN_FSTAT_FOR_ZIP_FDS includes Node v22.22.3+ without covering v22.22.0 through v22.22.2.

I also added a focused unit test for the affected Node version ranges and regenerated the ESM loader artifacts.

Checklist

  • I have read the Contributing Guide.
  • 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
Copy link
Copy Markdown
Member

clemyan commented May 18, 2026

I think the CJS hook also need to be updated with yarn update:pnp:hook?

@junjuny0227
Copy link
Copy Markdown
Contributor Author

junjuny0227 commented May 18, 2026

I think the CJS hook also need to be updated with yarn update:pnp:hook?

@clemyan Thanks for pointing that out! I ran yarn update:pnp:hook and pushed the updated CJS hook artifacts in 8b0ae6d.

Please let me know if there's anything else I should adjust.

@arcanis arcanis merged commit fbb882b into yarnpkg:master May 21, 2026
26 of 27 checks passed
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.

[BUG] HAS_BROKEN_FSTAT_FOR_ZIP_FDS version gate should include Node 22.22+

3 participants