-
Hello, I wanted to know how I could debug in "attach" mode in adonisV5 using vscode, could someone help me? configuration I tried.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @taisso , I have configured one for you:
package.json:
Right, so while the first one "debug adonis" starts the server and attaches the debugger, the second one you use when your instance is already running. Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
The accepted answer helped me out, thanks so much @WeyIin! The test debug profile here will run all tests, breaking on whatever breakpoints you add. This could be improved to easily debug an individual test file. package.jsonJust including the relevant excerpt "scripts": {
"dev:debug": "node ace serve --watch --node-args=\"--inspect\"",
"test:debug": "node ace test --node-args=\"--inspect\"",
}, .vscode/launch.jsonIncluding it in it's entirety{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Web Server",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev:debug"],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "test:debug"],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "attach",
"name": "Attach to Debugger",
"port": 9229
}
]
}
|
Beta Was this translation helpful? Give feedback.
-
@davidharting You're a live-saver... that worked first time for me when I've never really been able to get it to work well with Adonis v5. Muito obrigado! |
Beta Was this translation helpful? Give feedback.
Hi @taisso ,
I have configured one for you:
package.json:
Right, so while the first one "debug adonis" starts the server and attaches the debugger, the second on…