sst: [ION-1430] Adding breakpoints in Live

Currently the launch config points to node_modules, need to try it with the new CLI.

https://discord.com/channels/983865673656705025/1177071497974648952/1221590450314416180

ION-219

ION-1430

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 21 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Workaround in the meantime:

  1. Install https://marketplace.visualstudio.com/items?itemName=augustocdias.tasks-shell-input

  2. Edit .vscode/launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug SST Live",
      "type": "node",
      "request": "attach",
      "processId": "${input:sst_pid}"
    }
  ],
  "inputs": [
    {
      "id": "sst_pid",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "ps | grep '.sst/platform/dist/nodejs-runtime/index.js' | grep -v grep | awk '{print $1}'",
        "useFirstResult": true
      }
    }
  ]
}
  1. Run sst dev

  2. Invoke what you’re trying to debug (e.g. Lambda function) if it needs to get warm

  3. Run the Debug SST Live configuration

  4. Set breakpoints

Lambda invocation should now trigger the breakpoint

The lack of debugger support is quickly becoming a show stopper. Separate node processes for each invocation also seems that it could complicate matters. Hope you guys have something planned here.

Yeah apparently @thdxr almost has it working.

 {
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug SST Live",
      "type": "node",
      "request": "launch",
      "runtimeArgs": ["dev"],
      "console": "integratedTerminal",
      "skipFiles": ["<node_internals>/**"],
      "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst"
    }
  ]
}

@jayair @thdxr the config mentioned on the sst.ion docs doestn’t seems like working. Is there any update on this issue?

Yeah it’s on the roadmap. We’ll get to this in the coming weeks.