samepage-network / samepage.network

samepage.network
MIT License
10 stars 2 forks source link

Investigate backend debugging in VSCode #99

Closed dvargas92495 closed 1 year ago

mdroidian commented 1 year ago

So I got a few methods to work.

  1. Auto Attach
  2. JavaScript Debug Terminal
  3. launch.json

Auto Attach

Run Command Palette Debug: Toggle Auto Attach > Smart / Always npm start

JavaScript Debug Terminal

Command Palette Debug: JavaScript Debug Terminal or image

npm start

launch.json

Add the following to .vscode/launch.json (adjust file location where necessary)

{
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Samepage Network Debug",
      "runtimeArgs": ["-r", "ts-node/register"],
      "args": ["${workspaceFolder}/samepage.network/scripts/cli.ts", "start"],
      "cwd": "${workspaceFolder}/samepage.network"
    }
  ]
}

Then F5 or Go to the Run and Debug tab image

mdroidian commented 1 year ago

I'm going to run with #2 and #3 and will reopen this if they are unreliable.

dvargas92495 commented 1 year ago

Number 3 is the ideal solution - I think there's a way to share configs like this in the repo directly via a .vscode folder or something of the sort - would love to have that added