我试图跟踪VSCode网站https://code.visualstudio.com/docs/nodejs/browser-debugging#_open-link-command的Javascript调试设置--这里缺少很多信息,当我试图从网站复制launch.json配置时,如果我使用自己的launch.json配置,我就会得到错误VSCode and Javascript: cannot connect to the target at localhost:9222
,我不能点击任何断点,在调试时断点都会变成白色的圆圈。
第一个问题:为什么URL指向"http://localhost:8080"? VSCode自动启动服务器?我需要为此下载一个扩展吗?而在第一个配置中,"http://localhost/test/index.html“指向我的XAMPP服务器。
第二个问题:看起来没有启用调试启动边缘,在VSCode中可以添加这一行吗?VSCode不是自动从这个开始吗?我可以在launch.json中指定边缘可执行路径吗?
第三个问题:我也尝试用这个属性"runtimeExecutable" : "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe --remote-debugging-port=9222 --user-data-dir=remote-debug-profile"
添加边沿的绝对路径,并从attach
更改为launch
,但是我得到了错误unable to launch browser, available auto-discovered versions are ["stable"]
,如何在这里输入确切的路径和参数?
我的Launch.json在以下,不允许命中断点
{
"version": "0.2.0",
"configurations": [
{
"type": "msedge",
"request": "launch",
"name": "Launch Edge Against Localhost",
"url": "http://localhost/test/index.html",
"webRoot": "${workspaceFolder}"
}
}
]
}
Launch.json来自VSCode网站,导致错误
{
"version": "0.2.0",
"configurations": [
{
"type": "msedge",
"request": "attach",
"name": "Attach to browser",
"port": 9222,
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
index.html在下面
<head>
<title>Read Text File</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="myDynamicTable"></div>
<script>
window.onload = () => {
document.write("TEST:");
}
</script>
</body>
发布于 2022-11-04 03:41:45
0000000000000000000000
你安装node.JS了吗?
0000000000000000000000
https://stackoverflow.com/questions/74311112
复制相似问题