Open
Description
Version
20.3.1
Platform
Darwin mbp.peet.io 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_X86_64 x86_64
Subsystem
inspector
What steps will reproduce the bug?
- Start a program containing
throw new Error('foo');
in an ES module - Attach a debugger, like devtools or VS Code's debugger, and enable "pause on uncaught exceptions"
- Run the program
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
The runtime should pause on the throw
line
What do you see instead?
The runtime does not pause and the program exits
Additional information
First reported in microsoft/vscode-js-debug#1861
Guessing this is because module evaluation is in a try/catch. Wonder if there's any machinery that can be used to mark containing exceptions as uncaught
node/lib/internal/modules/esm/module_job.js
Lines 217 to 219 in 0a0b8df