Visual Studio 代码调试

问题描述 投票:0回答:1

我正在尝试在 Visual Studio 代码中调试 javascript 代码,但它给了我以下错误

Could not read source map for chrome-error://chromewebdata/: Unexpected 503 response from chrome-error://chromewebdata/edge-elixir-neterror.rollup.js.map: Unsupported protocol "chrome-error:"

launch.json 文件有以下配置

{
    // 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": [
       
        {
            "name": "Launch Edge",
            "request": "launch",
            "type": "msedge",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        },
        
    ]
}

我尝试删除 .vscode 文件夹以及 launch.json 文件,下次尝试再次添加 Microsoft Edge 时没有任何效果。再次启动时,它向我显示此页面本地主机拒绝连接。我不明白为什么当我尝试使用 Edge 进行调试时它会给我 chrome 错误。

我有, Visual Studio代码:1.90.2版本 边缘:版本126.0.2592.68

javascript visual-studio-code google-chrome-devtools microsoft-edge visual-studio-debugging
1个回答
0
投票

请确保

http://localhost:8080
有一些内容并且可供您访问。您可以测试:

  1. 使用另一个有效 URL 作为“url”部分,检查 VS Code 端是否存在问题。
  2. 直接在浏览器中访问
    http://localhost:8080
    。如果无法访问,则意味着您刚刚在“url”部分使用了无效的 URL。

对我来说,只有在

http://localhost:8080
上没有任何内容的情况下,我才能重现此问题。将其替换为另一个有效的 URL 即可。

© www.soinside.com 2019 - 2024. All rights reserved.