#How to debug Nest JS app ?
24 messages · Page 1 of 1 (latest)
With console.log or a debugger?
debugger
example - any links, screenshots related to it will help ..
- via command line
- via IDE
- via third party tool
- via any Debugger tool
What editor or IDE are you using?
So, search in the Interwebs for "nodejs debugging with VSCode". Or, "nodejs debugggin with intellij".
I mean, the nest start command has the--debug flag ready to be used to exposeand connect to a node debugger according to your debugger of choice. localhost port 9229 by default (node's default) and it should be pretty easy to just start and attach. VSCode also has the JavaScript Debug Terminal, which can auto attach to any node script. Have you tried to get debugging working? Are you facing issues? Or are you asking before attempting?
- DevTools
npm i @nestjs/devtools-integration
snapshot: true
npm run start:dev
https://docs.nestjs.com/devtools/overview
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
snapshot: true,
});
await app.listen(3000);
}
-
Rookout
https://www.rookout.com/blog/debugging-nest-js-applications-examples-packages-config/ -
VS Debugger
https://dev.to/gentax/nestjs-right-settings-for-debugging-kl0
"scripts": {
...
"start:debug": "nest start --debug --watch",
...
}
npm run start:debug
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
Get started with debugging Nest.js applications with this tutorial from Rookout, which offers architecture examples and tips on installation and configuration.
I like the devtools-integration --> however it doesn't work ...not sure why. Does anyone has some more document or steps to use devtools-integration or step by step screenshot would help
With regards to devtools "not working" doesn't tell us what's happening. It's also, if I recall correctly, not explicitly a debugging tool, it's a visual aid to help with the structure of your application.
i want to visual aid + debug + visual aid during debugging...that's what is my expectation
going through the flow in debugging mode via breakpoint is not that great in general
What language are you coming from where this is a thing?
javascript
Nest is JavaScript.
Is it possible to visualize or visual aid using the above devtools using debugging. the links says we can do both...but not able to do so
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
I don't see why you couldn't use the dev tools and the --debug flag at the same time, if that's what you're asking
But I don't think they'd integrate with each other in the way you want
any way to get the visual when we debug or during debug other than devtools ?
I'm not even aware of that being a usual thing in most languages. The debugger steps through the code, you should have a mental model of what you're code execution flow looks like
I think he might be expecting something like Vue's devtool. https://devtools.vuejs.org/