zed icon indicating copy to clipboard operation
zed copied to clipboard

Debugger: DAP immediately disconnects when breakpoints are used in jest tests

Open icholy opened this issue 1 month ago • 0 comments

Summary

I'm having a strange issue where adding breakpoints to jest tests prevents it from running.

Description

I've created a minimal repro here: https://github.com/icholy/zed-jest-debugger-repro

Steps to trigger the problem:

  1. git clone [email protected]:icholy/zed-jest-debugger-repro.git
  2. cd zed-jest-debugger-repro
  3. nvm use 24
  4. npm ci
  5. Open Zed
  6. Set a breakpoing in example.spec.ts on line 2
  7. Run 'Run Example Test' debug config.

Note: if I remove the breakpoint, the tests run.

Expected Behavior:

Tests run and hit breakpoint.

Actual Behavior:

It prints "Debugger attached." and dies.

Zed Version and System Specs

Zed: v0.213.3 (Zed) OS: Linux X11 ubuntu 24.04 Memory: 62.7 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 3060 || NVIDIA || 535.274.02

If applicable, attach your Zed.log file to this issue.

Zed.log
2025-11-23T11:16:03-05:00 ERROR [crates/project/src/debugger/session.rs:1744] no adapter running to send request: ThreadsCommand
2025-11-23T11:16:03-05:00 INFO  [dap::transport] Debug adapter has connected to TCP server 127.0.0.1:36059
2025-11-23T11:16:13-05:00 INFO  [dap::transport] Debug adapter has connected to TCP server 127.0.0.1:36059
2025-11-23T11:16:13-05:00 ERROR [crates/project/src/debugger/dap_store.rs:492] Could not find session: SessionId(0)
2025-11-23T11:16:13-05:00 INFO  [dap::transport] Debugger closed the connection
2025-11-23T11:16:13-05:00 INFO  [dap::transport] Debug adapter has connected to TCP server 127.0.0.1:36059
2025-11-23T11:16:13-05:00 ERROR [crates/project/src/debugger/session.rs:1744] no adapter running to send request: ThreadsCommand
2025-11-23T11:16:13-05:00 INFO  [dap::transport] Debugger closed the connection
2025-11-23T11:16:13-05:00 INFO  [dap::transport] Debugger closed the connection
2025-11-23T11:16:43-05:00 WARN  [project::debugger::session] Set breakpoints request failed for path: client is closed
2025-11-23T11:16:43-05:00 WARN  [project::debugger::session] Set breakpoints request failed for path: client is closed
2025-11-23T11:17:19-05:00 INFO  [lsp] starting language server process. binary path: "/home/icholy/.local/share/zed/node/node-v24.11.0-linux-x64/bin/node", working directory: "/home/icholy/src/github.com/compassdigital/cdl/npm/core", args: ["/home/icholy/.local/share/zed/languages/json-language-server/node_modules/vscode-langservers-extracted/bin/vscode-json-language-server", "--stdio"]

icholy avatar Nov 23 '25 16:11 icholy