vscode-js-debug icon indicating copy to clipboard operation
vscode-js-debug copied to clipboard

Debugger gets stuck after attaching. Sometimes works

Open joshua-rh opened this issue 2 years ago • 8 comments

Describe the bug I have a pretty basic launch config which I've hardcoded to run a single test with jest. On most runs, it would get stuck at Debugger attached.. I have to Reload window to resolve it.

I have also tried running jest through jest-cli, yarn but same result.

"type": "node",
"request": "launch",
"args": [
  "--watchAll=false",
  "test/jest/something.test.ts"
],
"name": "Run Jest",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"console": "integratedTerminal"

To Reproduce Run launch config.

Occasionally it works. For examples, once it ran 3 times successfully then gets stuck on the 4th. But most of the time it gets stuck.

Additional context: we have a monorepo, use yarn workspaces and I use a multi-root workspace.

For what it's worth, same thing happens when I run jest separately and attach the vscode debugger.

Log File

runtime.launch Bootloader imported {
  env: {
    inspectorIpc: '/var/folders/lb/f9whw1cj2vs10tmm1msy2k4h0000gn/T/node-cdp.67682-5614ab53-1.sock',
    deferredMode: false,
    waitForDebugger: '',
    execPath: '/opt/homebrew/opt/node@16/bin/node',
    onlyEntrypoint: false,
    verbose: true,
    autoAttachMode: 'always',
    fileCallback: '/var/folders/lb/f9whw1cj2vs10tmm1msy2k4h0000gn/T/node-debug-callback-f83d60bbfe5d3853'
  },
  args: [
    '/opt/homebrew/Cellar/node@16/16.20.0/bin/node',
    '<to my repo>/node_modules/jest/bin/jest.js',
    '--watchAll=false',
    'test/jest/something.test.ts'
  ]
}
runtime Set debug mode { mode: 0 }
Debugger attached.

VS Code Version: 1.77.3

Additional context Add any other context about the problem here.

joshua-rh avatar Apr 27 '23 17:04 joshua-rh

Please collect a log file using the instructions in the issue template. The log file location will be written to the Debug Console view, it looks like you've just got what's in the Terminal. That's sometimes useful, but not in this case

connor4312 avatar Apr 27 '23 18:04 connor4312

Hey thanks. Is it normal if the log file can't be uncompressed? All of the logs that has been generated have this issue.

gzip -d vscode-debugadapter-aa5be733.json.gz
gzip: vscode-debugadapter-aa5be733.json.gz: unexpected end of file
gzip: vscode-debugadapter-aa5be733.json.gz: uncompress failed

joshua-rh avatar Apr 27 '23 18:04 joshua-rh

Yea, it can happen if the log is grabbed before the session ends, but it's still readable.

connor4312 avatar Apr 27 '23 18:04 connor4312

Okay, I sent you a log to your email. Thanks for looking into it!

joshua-rh avatar Apr 27 '23 18:04 joshua-rh

I'm also hitting this since VS Code 1.78.0, with debug sessions taking an extraordinarily long amount of time to start (They started much faster in the previous VS Code version):

Log: vscode-debugadapter-9cc443f2.json.gz

segevfiner avatar May 04 '23 13:05 segevfiner

@segevfiner I'm curious what the log looked like in previous versions. I think your case is caused by fixing the IPv4/6 automatic fallback; I'm guessing sourcemaps for sources like http://localhost:5000/node_modules/.vite/deps/buffer.js?v=a237cbc0 don't load, and then we trigger a fallback, and the fallback request times out. I should also add some more logging around when this happens...

connor4312 avatar Jun 06 '23 19:06 connor4312

@connor4312 Which version would you like me to try and with which VS Code version?

segevfiner avatar Jun 11 '23 21:06 segevfiner

Installing a Nightly version before 2023.3.29** should work

connor4312 avatar Jun 12 '23 15:06 connor4312