Search code examples
govscode-debugger

How can I fix the vscode debuger in VSCode?


I'm trying to debug a simple Golang code in VSCode with dvl-dap and I get the following error:

enter image description here

Does anybody know how can I solved this issue?

I'm working from a remote vm using the extension Remote - SSH.


Solution

  • I'm adding this for reference in case someone else faces this issue.

    The fix was merged/released on v1.7.1, but I'm remote debugging on v1.8.3 and still hitting that problem.

    One possible workaround is to disable the 'same user' check in your VSCode settings.json, like this

    go.delveConfig": {
        "debugAdapter": "dlv-dap",
        "dlvFlags": ["--only-same-user=false"],
        [...]
    }
    

    and then just let VSCode use a default launch.json to run delve remotely and attach your local client -- in the project where I've tested this I haven't even defined a custom launch.json.