Skip to content

Instantly share code, notes, and snippets.

@pnhoang
Last active July 7, 2023 09:21
Show Gist options
  • Save pnhoang/5e3bd327c7a9bc2f0e973f99251c05cc to your computer and use it in GitHub Desktop.
Save pnhoang/5e3bd327c7a9bc2f0e973f99251c05cc to your computer and use it in GitHub Desktop.
Debug Vue.js application from VSCode

This document shows you how to debug Vue.js application from VS Code. https://v2.vuejs.org/v2/cookbook/debugging-in-vscode.html

The only problem that I get is that when I launched the debugger, it always opens the http://localhost:8080. And that's not what I want.

Instead, I want the debugger to start and step into the breakpoints when I open a link with Router directly for the first time.

An example: http://localhost:8080/#/IT/it/

In this case, what I did is: in VS Code, open the Command Palette: Cmd + Shift + P. Type in: Debugger: Open Link And type in the link above directly.

https://code.visualstudio.com/docs/nodejs/browser-debugging

Sometimes, VSCode can not set the breakpoint, as the last resort, we can add manually these two lines:

// eslint-disable-next-line
debugger;

Now, watch VSCode stops at the breakpoint and happy debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment