-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Bug?]: Yarns patching of the fs module subtly breaks in node >20.5.1 #5951
Comments
I have the same issue. Environment:
|
Same here Environment:
|
This is a Node bug which they don't see as a bug 🙁 (nodejs/node#39513) |
@arcanis thanks for the link. Holy guacamole, what a situation. I have two questions:
|
I'm not sure unfortunately. I've been pointed out to another issue on the Node.js Slack channels which, together with the first one, may be why this problem just appeared: nodejs/node#50435. |
…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.
…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)
This will be fixed in Node 20.11.0, per nodejs/node#50435 (comment) |
Self-service
Describe the bug
On node versions above 20.5.1, swc-node stops working with the following cryptic error:
This is due to the node js worker which deals with something related to custom esm modules has a reference to the unpatched
readFileSync
function from thefs
module, see swc-project/swc-node#736 (comment)To reproduce
Follow the steps outlined in this issue report: swc-project/swc-node#736 (comment)
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: