Home
Software
TIL
Contact Me
Zed debug setup for go server / Svelte web app
Today I figured out how to setup Zed to debug, at the same time, my go server and Svelte web app.
My dev setup for working on my web app is:
It’s possible to setup Zed to debug both server and frontend JavaScript code. In retrospect it’s simple, but took me a moment to figure out.
I needed to create the following .zed/debug.json:
// Project-local debug tasks
//
// For more documentation on how to configure debug tasks,
// see: https://zed.dev/docs/debugger
[
  {
    "adapter": "Delve",
    "label": "run go server",
    "request": "launch",
    "mode": "debug",
    "program": ".",
    "cwd": "${ZED_WORKTREE_ROOT}",
    "args": ["-run-dev", "-no-open"],
    "buildFlags": [],
    "env": {}
  },
  {
    "adapter": "JavaScript",
    "label": "Debug in Chrome",
    "type": "chrome",
    "request": "launch",
    "url": "http://localhost:9339/",
    "webRoot": "$ZED_WORKTREE_ROOT/src",
    "console": "integratedTerminal",
    "skipFiles": ["<node_internals>/**"]
  }
]
It’s mostly self-exploratory.
First entry tells Zed to build go program with go build . and run the resulting executable under the debugger with -run-dev -no-open args.
Second entry tells to launch Chrome in debug mode with http://localhost:9339/ and that files seen by Chrome come from src/ directory i.e. if browser loads /foo.js the source file is src/foo.js. This is necessary to be able to set breakpoints in Zed and have them propagate to Chrome.
This eliminates the need for terminal so I can edit and debug with just Zed and Chrome.
This is a great setup. I’m impressed with Zed.
til zed webdev svelte javascript programming
Jul 21 2025

Home
Software
TIL
Contact Me