

To use this launch.json configuration, first set a breakpoint somewhere in your application’s code. protocol – Which Node.js debugging runtime protocol to use.In this case, we’re indicating we want to use the integrated terminal in VSCode console – Which console to use when displaying debugging output.cwd – The current working directory for finding dependencies and other files.This is necessary if your application relies on environment variables stored in a. This is important as it allows us to step through the original TypeScript code, instead of the transpiled JavaScript sourceMaps – Use source maps, if found.

Because we are providing a TypeScript file directly to Node.js, we use ts-node to run the file without the manual use of the TypeScript compiler


The first approach relies on a launch.json file included in a. All that’s required is a little bit of tuning. While the NestJS documentation is comprehensive, one of the things that it currently does not cover in-depth is debugging.įortunately for us, VSCode makes it very straightforward to debug both your NestJS application code and tests written using the Jest testing framework. Among these features is excellent tooling for debugging applications, including built-in support for Node.js and TypeScript. Visual Studio Code, or VSCode, is a lightweight source code editor with cross-platform support that boasts an impressive variety of features. This article will take a look at three different techniques for debugging a NestJS application with VSCode.įor a quick introduction to NestJS, check out this article.
