Debug Universal JavaScript running in Node.js and Chrome from VS Code

The Visual Studio Code editor is popular among JavaScript developers. While it's not the IDE behemoth that the complete Visual Studio is, it's still able to provide debugging help for you.

With JavaScript, browsers and Node.js it's more and more common to execute the exact same code on the server and the client. This is somewhat of a new paradigm which requires some adjustment to your thought and how you write code.

Debugging this universal JavaScript that runs in different location completely adds the overhead to debugging as when when you were writing your APIs in Java / PHP / Ruby or some other language. Untapping unified debugging methods for client and browser environments holds immense promise.

With the release of Code 1.7 comes a new feature “multi-target debugging” that helps debugging multiple JavaScript targets. For web developers this means that you can connect a single code editor to both the browser and your server back end:

The feature is still experimental, but once you have configured multiple debugging targets you can work with your codebase from the simple editor and use the same debugging tools for all of your JavaScript code from a unified location.

As an added bonus you can use the feature to debug clustered server applications where you've got multiple instances of a single application.

Learn more about how to setup multiple target debugging from Code October Release notes.