baddisc.blogg.se

Visual studio code debug serverless
Visual studio code debug serverless







visual studio code debug serverless

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.

visual studio code debug serverless

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

  • runtimeArgs – Optional arguments that are passed to the runtime executable.
  • In this case, we provide the path to our main.ts file that is the entry point to the application
  • args – Arguments passed to the program that is being debugged.
  • name – The name you want to be associated with your debugging configuration.
  • This can be either launch or attach (either launch a new process or attach to an existing one)
  • request – The request type of the configuration.
  • In our case, it’s node but if you have a debugging extension for Go you could set it to go, etc.

    visual studio code debug serverless

  • type – Indicates the type of debugger to use.
  • Launch configuration for debugging NestJSĪ lot is going on in the above file, so let’s break it down attribute by attribute: This JSON file provides configuration information that VSCode uses while figuring out how to debug your application correctly.Ĭheck out these docs for more on configuring a launch.json file. vscode/ directory in the root of your workspace.

    visual studio code debug serverless

    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.









    Visual studio code debug serverless