Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node debugger doesn't break on unhandled promise rejection #130265

Closed
ferdaber opened this issue Aug 6, 2021 · 5 comments
Closed

Node debugger doesn't break on unhandled promise rejection #130265

ferdaber opened this issue Aug 6, 2021 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster verified Verification succeeded
Milestone

Comments

@ferdaber
Copy link

ferdaber commented Aug 6, 2021

Issue Type: Bug

When attempting to launch a file using pwa-node that runs a script like this:

async function crash() {
  new Promise(resolve => setTimeout(resolve, 1000));
  throw new Error('crash!');
}

crash();

With the "Uncaught Exceptions" box checked under Breakpoints, the program exits without breaking where I throw the error. The node version I am using is v14.17.4, and was able to reproduce it with v14.16.0 (the one that VSCode uses). I have tried it with all settings and extensions disabled, and even by reinstalling VSCode, and it still doesn't work.

VS Code version: Code 1.59.0 (379476f, 2021-08-04T23:13:12.822Z)
OS version: Windows_NT x64 10.0.19041
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.78GB (4.44GB free)
Process Argv --crash-reporter-id d54c4cbe-b545-41d3-b383-05429e18f989
Screen Reader no
VM 0%
Extensions: none
@weinand weinand assigned connor4312 and unassigned weinand Aug 10, 2021
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 10, 2021
@connor4312 connor4312 added the bug Issue identified by VS Code Team member as probable bug label Aug 10, 2021
@connor4312 connor4312 added this to the August 2021 milestone Aug 10, 2021
@justingrant
Copy link
Contributor

Thanks so much @ferdaber for reporting and @connor4312 for a really quick fix!

Is this going to be released in a patch release of 1.59? It'd be helpful if so, given that node debugging (at least in my app which is 100% async so every exception thrown is a promise rejection) is a very broken experience now.

If it won't be patched, any idea when was the last VSCode release where break-on-promise-rejection worked properly? This would be helpful because I'm planning to downgrade VSCode until this fix is released.

Or did this never work, and I'm now running into it because the code around mine (a wrapper package that I don't control) switched to async calls?

@connor4312
Copy link
Member

The easiest way to get the fix is to use the nightly build on Insiders.

@alexr00 alexr00 added the verified Verification succeeded label Aug 26, 2021
@pursual
Copy link

pursual commented Sep 13, 2021

Nightly build on insiders still does not catch unhanded rejections. They get logged in the debug console, but not with any identifying information.

@connor4312
Copy link
Member

/jsDebugLogs

@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@justingrant @pursual @weinand @connor4312 @ferdaber @alexr00 and others