Skip to content Skip to sidebar Skip to footer

How To Debug Javascript In Visual Studio Code With Live-server Running

Trying to debug a simple HTML and JavaScript project in Visual Studio Code. In the VS Code terminal window, 'live-server' is used to launch the 'index.html'. In VS Code, the 'Debug

Solution 1:

Works for me:

  1. Install Debugger for chrome extension on your VS Code.
  2. Install and activate Live Server extension on your VS Code.
  3. Press F5 and select Chrome:

enter image description here

  1. Check your Live Server port* and change the generated launch.json

enter image description here

  1. Set your break points, run Live Server and press F5:

enter image description here

  1. Enjoy :)

  • To check your Live Server port:
  1. Install Live Server & reload VS Code.
  2. Go to Preferences > Extensions > Live Server Config
  3. Scroll down to find Settings: Port and click "Edit in settings.json". Then you'll see the port number.

Post a Comment for "How To Debug Javascript In Visual Studio Code With Live-server Running"