diff options
| author | Patrick Schiel <[email protected]> | 2025-12-24 18:07:12 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-24 11:07:12 -0600 |
| commit | 0f053769db5bf17474b9c1f66ae7966ff098974a (patch) | |
| tree | ceac8ae6540e645a7f0edcb780e01f26c8a4e331 | |
| parent | ceeaf494c4c491982c7164534c766795a2c6d70b (diff) | |
| download | opencode-0f053769db5bf17474b9c1f66ae7966ff098974a.tar.gz opencode-0f053769db5bf17474b9c1f66ae7966ff098974a.zip | |
docs: add infos about server debugging (#6085)
| -rw-r--r-- | CONTRIBUTING.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c16d664a2..52d342709 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,12 +53,12 @@ your debugger via that URL. Other methods can result in breakpoints being mapped Caveats: -- `*.tsx` files won't have their breakpoints correctly mapped. This seems due to Bun currently not supporting source maps on code transformed - via `BunPlugin`s (currently necessary due to our dependency on `@opentui/solid`). Currently, the best you can do in terms of debugging `*.tsx` - files is writing a `debugger;` statement. Debugging facilities like stepping won't work, but at least you will be informed if a specific code - is triggered. - If you want to run the OpenCode TUI and have breakpoints triggered in the server code, you might need to run `bun dev spawn` instead of the usual `bun dev`. This is because `bun dev` runs the server in a worker thread and breakpoints might not work there. +- If `spawn` does not work for you, you can debug the server separately: + - Debug server: `bun run --inspect=ws://localhost:6499/ ./src/index.ts serve --port 4096`, + then attach TUI with `opencode attach http://localhost:4096` + - Debug TUI: `bun run --inspect=ws://localhost:6499/ --conditions=browser ./src/index.ts` Other tips and tricks: |
