4

I come from developing in ASP.NET MVC/C# using Visual Studio. In this stack, debugging is very thorough and straightforward. You create a project, code, set breakpoints, and hit F5 to step through them.

What are my options with Node.js? Specifically using Visual Studio Code? I've tried setting up a debug config file but it has mixed results, and seems to be a lot more error-prone than debugging in C#/Visual Studio. Is there any way to get debugging features streamlined in Node the same way I am used to in Visual Studio with C#? I know JS is interpreted rather than compiled...

Update: I have tried clicking the debug button and setting up a launch.json file. However, this usually leads me into errors. For example, I have set up launch.json to my app's entry point and my app uses an MVC pattern. When I launch the app, the debugger stops at the breakpoint before I even visit the controller endpoint, whereas in Visual Studio with C#, the debugger would listen and when I visit the endpoint, it would then stop at the breakpoint so that I could step through. The Visual Studio Code/Node debugger seems to want to step through all breakpoints before the endpoints are even triggered. I have also tried the Nodejs Tools extension for Visual Studio 2015 Community, which produced Microsoft Typescript errors. It just deosn't seem very straightforward.

the_endian
  • 2,259
  • 1
  • 24
  • 49

2 Answers2

0

have you tried using Chrome? When in Chrome press F12 to get the Developers Tools displayed, then you have the output console and can see the source and set break points.

Ron
  • 71
  • 2
  • 6
0

Here are some options for debugging node outside of visual studios: How do I debug Node.js applications?

Now for backend, I would recommend using Postman for Chrome: https://www.getpostman.com/

It will consume any API and allow you to see if the information you have entered is correct. A huge time saver if you want to check the routes of an API, the parameters being sent to the API, and data being sent back.

It would seem as most people don't know how to use or know that it can even be used to debug in visual studios.

Community
  • 1
  • 1