我无法在 Linux Mint 上的 VS Code 中运行 Chrome 调试器

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

您好,我在 VS Code 中直接运行 Chrome 调试器时遇到问题。我正在研究 Linux Mint。这就是我的 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": [
   
   
    {
        "type": "pwa-chrome",
        "request": "launch",
        "name": "Launch Chrome against localhost",
        "file": "${workspaceFolder}/index.html"
        
        
      
    }
]

}

现在我尝试运行调试器,错误消息显示:无法启动浏览器:“无法找到稳定的 Chrome 版本。可用的自动发现版本是:[“dev”]。您可以在 launch.json 中设置“runtimeExecutable”其中之一,或提供浏览器可执行文件的绝对路径。”

按照建议,我将runtimeExecutable添加到chrome可执行文件中,如下所示:

runtimeExecutable:“/opt/google/chrome/google-chrome”,现在错误消息显示:

无法附加到浏览器。

我的机器上安装的 Google Chrome 版本:83.0.4103.116-1。

提前感谢您的帮助

Error Current Config

javascript visual-studio-code linux-mint chrome-debugging
3个回答
2
投票

我还在 Linux Mint 上使用 Chromium。 我解决了这个问题

debug.javascript.usePreview:VS 设置中为 false,

这个答案

中所述

1
投票

您也需要添加

webroot
属性,试试这个

{
    "name": "Launch Chrome",
    "request": "launch",
    "type": "pwa-chrome",
    "url": "${workspaceFolder}/index.html",
    "webRoot": "${workspaceFolder}"
},

0
投票

Html 站点无法在 vsc 中工作。有或没有调试器

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