I have a large code base of Azure Functions (Typescript) that I manage using VS Code and the Azure Functions extension. I am using VS Code in WSL (Windows). I've been able to debug these functions in VS Code for a few years with no problems. However, I've started to notice odd behavior:
- VS Code started not picking up code changes after stopping and restarting the debugger. I would have to manually run
npm run build. - Hitting the "Stop" debugging button would not kill the process, and the function would keep running.
- Now when I start debugging, I don't see the debugging toolbar (with stop, stepover, etc.). When I try to "dock" it using VS Code settings, it appears for a bit, then disappears. Breakpoints are no longer hit.
The above issues started after a few recent updates of VS Code. I'm at the point where I can't debug anything. Here are some things I've tried:
- Checking launch.json and tasks.json to ensure everything is set up correctly. See below for current versions.
- Used Copilot to generate a new launch.json (just created other issues).
- Updating Azure Functions Core Tools and the Azure Functions extension.
- Clearing all cache folders and restarting VS Code.
- Re-installing VS Code.
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
}
]
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",
"problemMatcher": "$func-node-watch",
"isBackground": true,
"dependsOn": "npm build (functions)"
},
{
"type": "shell",
"label": "npm build (functions)",
"command": "npm run build",
"dependsOn": "npm clean (functions)",
"problemMatcher": "$tsc"
},
{
"type": "shell",
"label": "npm install (functions)",
"command": "npm install"
},
{
"type": "shell",
"label": "npm prune (functions)",
"command": "npm prune --production",
"dependsOn": "npm build (functions)",
"problemMatcher": []
},
{
"type": "shell",
"label": "npm clean (functions)",
"command": "npm run clean",
"dependsOn": "npm install (functions)"
}
]
}