### Version v23.1.0 ### Platform ```text Linux akait-notebook 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ``` ### Subsystem _No response_ ### What steps will reproduce the bug? ```js const fs = require("fs"); fs.readFile("/", err => { console.log(err); }); fs.readFile("/", err => { console.log(err); }); ``` ### How often does it reproduce? Is there a required condition? Always ### What is the expected behavior? Why is that the expected behavior? Like in `Node.js@22`, each callback should be run with `err` and `code` should be `EISDIR` ### What do you see instead? The call happens only once for the first call and the callbacks are not called instead an error is thrown like for sync function ### Additional information Ref: https://github.com/webpack/webpack/pull/18891
Activity
avivkeller commentedon Oct 30, 2024
AFAICT this is not the case. While I'm able to reproduce the issue, no call appears to use the callback, and an error is thrown.
This is because
getValidatedPathdoes not return the error to the callback, but instead throws it.alexander-akait commentedon Oct 30, 2024
@redyetidev In our case, we often call this function with
/, the second call does not even throw an error, sotry/catchdoesn't help in this casejuanarbol commentedon Oct 31, 2024
I'll bisect.
juanarbol commentedon Oct 31, 2024
Same in macos
juanarbol commentedon Oct 31, 2024
The regression seems to be introduced by #54160
Maybe here? https://github.com/nodejs/node/pull/54160/files#diff-5cd422a9a64bc2c1275d70ba5dcafbc5ea55274432fffc5e4159126007dc4894R735-R741
juanarbol commentedon Nov 3, 2024
The regression is reverted, I'm closing this issue.
snitin315 commentedon Nov 3, 2024
@juanarbol When will be the patch released?