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

Debug NPM Script hangs #219673

Closed
f8k8 opened this issue Jul 2, 2024 · 1 comment · Fixed by microsoft/vscode-js-debug#2031
Closed

Debug NPM Script hangs #219673

f8k8 opened this issue Jul 2, 2024 · 1 comment · Fixed by microsoft/vscode-js-debug#2031
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@f8k8
Copy link

f8k8 commented Jul 2, 2024

Type: Bug

Reproduction available at: https://github.com/f8k8/VSCodeNPXBug

When running the project linked above using Debug NPM script, the first call to execSync doesn't seem to clean up properly and the second call hangs and is unable to be debugged. This only happens when the script is run from within VS Code. Running the script from the command prompt completes correctly.

Steps to reproduce:

  1. Run npm i to install dependencies
  2. From a command prompt, run npm run run. The script will complete correctly.
  3. Open the project in VS Code.
  4. Open the command pallette, and run Debug: Debug NPM script.

Expected results:

When running in VS Code, both calls to execSync should complete correctly.

Actual results:

The first call to execSync returns after completion, but there is still another process, displayed as Node.js Process 2 in the Call Stack window. This process doesn't have any debug controls. The only option is to disconnect. The second call to execSync is then attempted but doesn't seem to do anything. In the terminal, done format is printed and then there is no more displayed. If you press CTRL-C in the terminal window, the Process 2 process ends, but the main process is still active, even though you are returned to the command prompt.

VS Code version: Code 1.90.2 (5437499, 2024-06-18T22:34:26.404Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 4200)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.93GB (6.68GB free)
Process Argv --crash-reporter-id 2825093d-42ce-4844-9043-fb109aceb08c
Screen Reader no
VM 0%
Extensions (4)
Extension Author (truncated) Version
vscode-eslint dba 3.0.10
prettier-vscode esb 10.4.0
vscode-react-native msj 1.13.0
prisma Pri 5.16.1
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelc:31048052
dsvsc021:30996838
bdiig495:31013172
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
legacy_priority:31082724

@connor4312
Copy link
Member

Thanks for the good repro

@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Jul 3, 2024
@connor4312 connor4312 added this to the July 2024 milestone Jul 3, 2024
@meganrogge meganrogge added the verified Verification succeeded label Jul 23, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 17, 2024
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 verified Verification succeeded
Projects
None yet
4 participants