Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code debugging client side JavaScript

I am using Visual Studio Code for a javascript project. You can set breakpoints and step through and debug very easily the code that runs in nodejs. Is there any way to allow breakpoints and debugging for the client side, browser running code?

Debugging via console.log gets old real quick.

like image 203
Phil Wright Avatar asked Dec 10 '22 20:12

Phil Wright


1 Answers

For debugging in Chrome there is the Visual Studio Code: Debugger for Chrome extension. You can find this extension in the marketplace, search for debugger as told in the debugging manual. Unfortunately there is (currently) no support for other browsers,

Debugging node.js works out of the box, see the debugging manual above or John Papa's blog post.

Debugging both client and server (as Phil commented) is not possible at least in my opinion since you need to have two different launch configurations, sorry.

like image 114
ChrLipp Avatar answered Jan 01 '23 06:01

ChrLipp