You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the binding.fs parameter should ONLY be added if the version is greater or equal to 22.10. Maybe we should try to find the commit in Node to ensure that there is no others conditions.
I use this library through import-sync, but I can't import this library anymore.
I debugged it and found it comes from this exact line.
esm/src/fs/stat-fast.js
Line 70 in aa8723a
I checked what should be the second argument (as told by the error)
https://github.com/nodejs/node/blob/9b6cea6ebe1942e24dc096b1bae53ecfacb781b2/lib/internal/modules/cjs/loader.js#L239C55-L239C72
The patch should be
But the
binding.fs
parameter should ONLY be added if the version is greater or equal to 22.10. Maybe we should try to find the commit in Node to ensure that there is no others conditions.You can find a reproduction at https://github.com/arthur-fontaine/htk-esm-internal-crash-repro. It doesn't use the @httptoolkit/esm library, but I copied its code and tried to reduce it to localize the bug. (look for the "HERE IS THE BUG" comment in
esm/loader.js
)EDIT:
I think this is the commit where
internalModuleStat
started to require 2 parameters nodejs/node@f5d454a.EDIT2:
The PR on Node that added the second parameter on
internalModuleStat
: nodejs/node#54408EDIT3:
Checking if Node is version 22.10 or greater seems to be the only condition. Then the patch should look like
The text was updated successfully, but these errors were encountered: