vscode 使用JavsScript debugger 插件调试Vue+vite项目

vscode 使用JavsScript debugger 插件调试Vue+vite项目,JavsScript debugger 插件是vscode自带的,我用的vscode 版本Version: 1.88.1

插件有了,试着点击vscode 运行和调试按钮

选择Web App(Chrome)

出现Launch Chrome against 点击运行

启动了Chrome,项目启动失败,因为端口改为了8080 并且自动生成了launch.json文件

需要先启动项目 npm run dev 或者yarn dev, 把launch.json端口改成项目的端口,关掉先前调试的浏览器窗口,重新开始运行调试。

kotlin 复制代码
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:5173", // 换成项目的端口
      "webRoot": "${workspaceFolder}"
    }
  ]
}

进入断点了,但是另一个文件断点却是没生效,unbound,因为项目还没执行到没生效的那个文件,执行到这个文件,就生效了,如下图

也可以新建js debug terminal 运行项目打开调试断点


想要在vite.config.ts打断点,需要新建js debug terminal,运行项目,断点自动执行

相关推荐
纪伊路上盛名在2 天前
记1次BioPython Entrez模块Elink的debug
前端·数据库·python·debug·工具开发
春日见3 天前
虚拟机上由于网络问题无法正常git clone
linux·服务器·网络·人工智能·git·ubuntu·debug
草帽lufei4 天前
VSCode+PicGo实现Markdown图床自动同步
markdown·visual studio code
掘金安东尼5 天前
VSCode V1.107 发布(2025 年 11 月)
前端·visual studio code
单身的人上天堂5 天前
开发中使用iconfont预览太麻烦?我开发了一款VSCode插件来提升效率
前端·javascript·visual studio code
春日见5 天前
ubuntu以前可以联网,突然无法上网了
linux·服务器·ubuntu·debug
han_5 天前
手把手教你写一个VSCode插件,从开发到发布全流程
前端·javascript·visual studio code
Lei活在当下5 天前
【项目踩坑实录】并发环境下,Glide缓存引起的图片加载异常
android·debug·glide
小灰6 天前
VS Code插件的发布与自动化
visual studio code
想努力找到前端实习的呆呆鸟9 天前
vscode编写vue代码的时候一聚焦就代码块变白?怎么回事如何解决
vue.js·visual studio code