在 VS Code 中运行 Chrome 调试器的问题

Adr*_*muj 16 visual-studio-code chrome-debugging

嗨,我在 VS Code 中直接运行 Chrome 调试器时遇到了问题。我正在研究 Linux Mint。

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

在 sugesstion 之后,我将 runtimeExecutable 添加到 chromeExecutable ,现在错误是:

无法附加到浏览器。

我的机器上安装了谷歌浏览器版本:83.0.4103.116-1。

提前感谢您的帮助

错误: 错误

当前配置: 当前配置

Ben*_*Ben 15

我也有同样的问题。并找到了如何设置

debug.javascript.usePreview: false in VS settings
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

  • 您能否解释一下此设置的作用以及为什么禁用它可以解决问题?我尝试了你的解决方案,但没有成功。我尝试了 Shivam Gupta 提出的解决方案,但直到我重新启用 `debug.javascript.usePreview` 后它才起作用。 (2认同)

Shi*_*pta 15

1. Type chrome://version/ in Chrome browser.
2. Notice you will get some thing like this ::: 
Run Code Online (Sandbox Code Playgroud)

谷歌浏览器:: 86.0.4240.80(官方版本)(x86_64)

修订:: 7ed88b53bda45a2d19efb4f8706dd6b6cad0d3af-refs/branch-heads/4240@{#1183}

操作系统:: macOS 版本 10.15.7(构建 19H2)

JavaScript :: V8 8.6.395.10

Flash :: 32.0.0.445 /Users/shivamgupta/Library/Application Support/Google/Chrome/PepperFlash/32.0.0.445/PepperFlashPlayer.plugin

用户代理:: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36

命令行:: /Applications/Chrome.app/Contents/MacOS/Google Chrome -psn_0_57358 --flag-switches-begin --flag-switches-end --restore-last-session

可执行路径:: /Applications/Chrome.app/Contents/MacOS/Google Chrome

配置文件路径:: /Users/shivamgupta/Library/Application Support/Google/Chrome/Default

变化:: 84085631-ab02a1cf dff70c3e-377be55a .......,.

将可执行路径复制到 runTimeExecutable

Now Copy this snippet in launch.json::
"configurations": [
    {
      "name": "Launch Chrome",
      "request": "launch",
      "type": "pwa-chrome",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}/public",
      "runtimeExecutable": "/Applications/Chrome.app/Contents/MacOS/Google Chrome"
    }
]
Run Code Online (Sandbox Code Playgroud)