In this categoryVS Code Setup · 25
- How to Set Up GitHub Copilot in VS CodeStart
- How to Use Copilot Chat and Inline Chat in VS Code
- How to Install and Manage Extensions in VS Code
- How to Install the Continue Extension in VS Code
- How to Install Cline, the Autonomous Coding Agent, in VS Code
- How to Configure Continue with an API Model
- How to Set Up an AI Assistant in VS Code
- How to Run Continue with a Local Model Using Ollama
- How to Run Copilot, Continue, and Cline Together Without Conflicts
- How to Add an MCP Server to Cline
- How to Fix AI Suggestions Not Appearing in VS Code
- How to Install and Trust an AI Extension in VS Code
- How to Install a VS Code Extension from the Command Line
- How to Create a launch.json to Debug a Node.js App in VS Code
- How to Initialize a Git Repository in VS Code
- How to Stage, Commit, and Push Changes from VS Code
- How to Debug a Browser App in VS Code with the Built-in Chrome Debugger
- How to Resolve Git Merge Conflicts in VS Code
- How to Run Build and Dev Commands with tasks.json in VS Code
- How to Add Environment Variables to a VS Code Debug Configuration
How to Debug a Browser App in VS Code with the Built-in Chrome Debugger
Attach VS Code's debugger to a running dev server so you can set breakpoints in your front-end code and step through it in the editor.
Debugging front-end JavaScript usually means jumping into the browser DevTools. VS Code can run the debugger inside the editor instead, so your breakpoints live in the same files you edit. This guide attaches the built-in JavaScript debugger to a local dev server and steps through browser code without leaving VS Code.
What you need
- A web project with a dev server (Vite, Create React App, or similar)
- Google Chrome or Microsoft Edge installed
- VS Code 1.46 or newer (the JavaScript debugger is built in)
Step 1: Start your dev server
In the integrated terminal, run your dev server and note the local URL it prints. The debugger needs that exact address to attach to.
Step 2: Add a Chrome launch configuration
Open Run and Debug with Ctrl+Shift+D, click create a launch.json file, and choose Web App (Chrome). Edit the url so it matches your dev server, and set webRoot to the folder that holds your source files.
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug in Chrome",
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}/src"
}
]
}Step 3: Set a breakpoint in your code
Open a source file, such as a click handler, and click the gutter to place a breakpoint on the line you want to inspect. The debugger maps the compiled browser code back to your source using source maps, which most dev servers enable by default.
Step 4: Launch and trigger the code
Press F5. A new Chrome window opens at your dev server URL, controlled by VS Code. Interact with the page so the code runs; click the button that triggers your handler. Execution pauses at the breakpoint and focus jumps back to VS Code.
Step 5: Inspect state and continue
Read the Variables panel to see the value of count and next at this moment. Use F10 to step over and F5 to continue. Edit your code, save, and the dev server hot-reloads the page so you can test the fix immediately.
Result
Your front-end code now pauses inside VS Code with full variable inspection, mapped to the real source files. You can debug a browser app without ever opening DevTools.
Watch related tutorials
24:16
05:00
26:00
24:18
15:50
1:42:18New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.