#Add breakpoint to Controller endpoints
16 messages · Page 1 of 1 (latest)
Do the breakpoints work elsewhere?
It doesn't work elsewhere neither
I'm running apps (nestjs and nextjs) in nx workspace
Them most likely your launch configuration is wrong. Can you show the project.json?
Btw, since you're using VS Code, you can just launch the application through the built-in JavaScrip Debug Terminal and it should attach debugger automatically without setting up anything
You can open it with the + on the top right of the terminal window
Just tried that, enabled auto-attach: always and opened fresh vscode's integrated JavaScript Debug Terminal and ran nx script to start my nestjs app, but still says unbound breakpoint
I do not have project.json file, did you meant launch.json?
And is that lanuch.json necessary when using auto-attach: always enabled,?
Perhaps it's not possible to debug nx apps with auto-attach: always? I should have launch.json i guess then?
It seems adding a launch.json configuration worked well!
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/apps/api/src/main.ts",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**/*.js"
]
}
]
}
I meant project.json from NX. But maybe you're using the old version of NX, so all configurations are in nx.json (or workspace.json). I wanted to see the 'debug' or 'serve' configuration of your NestJS application
I do have nx.json and workspace.json
nx.json
{
"npmScope": "priv",
"implicitDependencies": {
"workspace.json": "*",
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
"tsconfig.json": "*",
"tslint.json": "*",
"nx.json": "*"
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/workspace/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e"
]
}
}
},
"projects": {
"web": {
"tags": [
"scope:web"
]
},
"api": {
"tags": [
"scope:api"
]
}
}
}
--
workspace.json
yes it seems I'm using older nrwl packages, example for nest: "@nrwl/nest": "12.0.7",
Hi Kulic, I was curious if you managed to get your breakpoints working with Nx? In the last 3 days, my breakpoints are suddenly unbound while debugging with VSCode. This occurs even with a fresh Nx project. No idea what is causing it
In a fresh npx create-nx-workspace@latest, with VSCode launched with code . --disable-extensions, breakpoints do not seem to work.