Skip to content
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

fix(pnp) esm - support loaders importing named exports from commonjs #5961

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Nov 11, 2023

What's the problem this PR addresses?

nodejs/node#48842 changed it so that our fs patch is loaded after the internal translators so ESM importing named CJS exports in loaders doesn't work.

Fixes #5951

How did you fix it?

Updated our ESM loader patching to target the fs bindings used internally.

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.

@merceyz merceyz force-pushed the merceyz/fix/pnp-esm-named-cjs-loader branch from f965cc4 to 9d2ff32 Compare November 11, 2023 02:08
@merceyz merceyz marked this pull request as ready for review November 11, 2023 13:45
@merceyz merceyz force-pushed the merceyz/fix/pnp-esm-named-cjs-loader branch from 4da62cf to 7ade461 Compare November 13, 2023 17:01
@arcanis arcanis merged commit 6e920f9 into master Nov 14, 2023
24 checks passed
@arcanis arcanis deleted the merceyz/fix/pnp-esm-named-cjs-loader branch November 14, 2023 09:11
merceyz added a commit that referenced this pull request Nov 14, 2023
…5961)

**What's the problem this PR addresses?**

nodejs/node#48842 changed it so that our fs
patch is loaded after the internal translators so ESM importing named
CJS exports in loaders doesn't work.

Fixes #5951

**How did you fix it?**

Updated our ESM loader patching to target the `fs` bindings used
internally.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

(cherry picked from commit 6e920f9)
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?]: Yarns patching of the fs module subtly breaks in node >20.5.1
2 participants