Skip to content

Debugging JavaScript

Apolo Pena edited this page May 5, 2021 · 5 revisions

Overview

Eventually in a project's lifecycle, the need to debug JavaScript runtime issues can arise. VS Code has a nice built-in debugger which can be used to debug JavaScript. The approach you will take to debug JavaScript with a debugger will depend on the type of JavaScript you want to debug. There are two main types of JavaScript:

  • server-side JavaScript
    • This is essentially node.js code and does not run in the browser.
  • client-side JavasScript
    • This is any JavaScript that is running in the browser.

Debugging server-side JavaScript

You can debug 'node.js` code using the VS Code debugger. Have a look at this example for more information.

Debugging client-side JavaScript

Developing in the cloud requires running VS Code from a Docker container, hence, using the VS Code debugger to debug client-side JavaScript is not currently possible without impratical (VNC) or untested methods such as ngrok.

You can however use the chrome tools debugger.

Clone this wiki locally