我正在嘗試從 VSCode 網站
https://code.visualstudio.com/docs/nodejs/browser-debugging#_open-link-command跟蹤 Javascript 的除錯設定
當我嘗試復制啟動時,這缺少很多資訊來自網站的.json配置,我收到錯誤VSCode and Javascript: cannot connect to the target at localhost:9222
如果我使用自己的launch.json配置,我無法命中任何斷點,除錯時斷點都變成白色圓圈
第一個問題:為什么URL指向“http://localhost:8080”?VSCode 會自動啟動服務器嗎?我需要為此下載擴展程式嗎?而在第一個配置中,“http://localhost/test/index.html”指向我的 XAMPP 服務器
第二個問題:看起來它不是在啟用除錯的情況下開始邊緣,我可以在 VSCode 的哪個位置添加這一行?edge.exe --remote-debugging-port=9222 --user-data-dir=remote-debug-profile它不會自動啟動嗎?我可以在 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>
uj5u.com熱心網友回復:
你安裝了node.JS嗎?
000000000000000000000000000
000000000000000000000000000
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/527227.html
