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,运行项目,断点自动执行

相关推荐
Feel_狗焕3 天前
Linux下GDB调试一篇入魂(GDB调试详解)
linux·debug
移民找老国5 天前
加拿大:一场生活与梦想的邂逅
beautifulsoup·intellij-idea·numpy·生活·fastapi·visual studio code·myeclipse
风也温柔☆5 天前
eclipse断点调试(用图说话)
java·eclipse·debug
西木九5 天前
VScode Python debug:hydra.run.dir 写入launch.json
vscode·python·debug·hydra
眠りたいです6 天前
贪吃蛇项目:GameRun与GameEnd部分:游戏的主体运行与善后部分
c语言·笔记·学习·算法·游戏·visual studio code
FINAL_NO9 天前
IDEA-远程debug
jvm·intellij-idea·debug·远程
dingdingfish13 天前
又一个SQL Developer中调试存储过程的例子
oracle·debug·database·sqldeveloper·procedure
曼亿点14 天前
【PHP项目实战训练】——使用thinkphp框架对数据进行增删改查功能
开发语言·php·visual studio code
callMe小王17 天前
vscode 自定义编辑器(看完即入门)
前端·webview·visual studio code
Scoful19 天前
解决:GoLand能断点,但无法下一步debug | 下一步按钮是灰的
go·debug·断点·goland