Debugging TypeScript functions

Can someone please provide a tutorial on how to debug TypeScript functions on VSCode running netlify dev? I tried everything on the web and I just get “unbound breakpoint” from the VSCode debugger.

Hi @heliomx.

Can you try setting this as your .vscode/launch.json file?

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "netlify dev",
      "type": "node",
      "request": "launch",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/node_modules/.bin/netlify",
      "args": ["dev"],
      "console": "integratedTerminal",
      "env": { "BROWSER": "none" },
      "serverReadyAction": {
        "pattern": "Server now ready on (https?://[\w:.-]+)",
        "uriFormat": "%s",
        "action": "debugWithChrome"
      },
      "outFiles": ["${workspaceFolder}/.netlify/functions-serve/**/*.js"]
    }
  ]
}

Let me know how it goes.

Thanks!

1 Like

Hi, your answer was helpful, I’m using your launch.json. I just needed to remove the "outFiles" setting and it worked.

Thanks!

1 Like