Closed
Description
- Version: v14.10.1
- Platform: macOS Calalina 10.15.6
What steps will reproduce the bug?
Create a javascript file with the following contents:
const fs = require('fs/promises');
async function main () {
const result = await fs.readFile('/aaaaaa');
console.log(result);
}
main();
Then run the file either in the Chrome DevTools, VSCode Tools or NDB, ensuring you have ticked the pause on exceptions and pause on uncaught exceptions button.
How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior?
The debugger should pause on line 4, or perhaps an internal node script. Not sure, but it should break somewhere.
What do you see instead?
The code runs and normal, as if the pause button was never clicked.
Anything else?
When using the code below, using the promisify function from node, it works as expected.
const { promisify } = require('util');
const fs = require('fs');
const readFile = promisify(fs.readFile);
async function main () {
const result = await readFile('/aaaaaa');
console.log(result);
}
main();
This will pause on line 299 of the internal/util.js function.