Problem to run chrome debugger in VS Code

主宰稳场 提交于 2020-11-29 04:25:17

问题


Hi I've got a problem to run Chrome Debugger directly in VS Code. I'm working on Linux Mint.

Now i try to run debugger and error message says: Unable to launch browser: "Unable to find Chrome version stable. Available auto-discovered versions are: ["dev"]. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable."

Following the sugesstion I've added runtimeExecutable to chromeExecutable and now the error is:

Unable to Attach to the browser.

Google Chrome is installed on my machine version: 83.0.4103.116-1.

Thanks for help in advance

Error:

Current config:


回答1:


I have the same problem. And found how to set

debug.javascript.usePreview: false in VS settings




回答2:


1. Type chrome://version/ in Chrome browser.
2. Notice you will get some thing like this ::: 

Google Chrome 86.0.4240.80 (Official Build) (x86_64) Revision 7ed88b53bda45a2d19efb4f8706dd6b6cad0d3af-refs/branch-heads/4240@{#1183} OS macOS Version 10.15.7 (Build 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 User Agent 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 Command Line /Applications/Chrome.app/Contents/MacOS/Google Chrome -psn_0_57358 --flag-switches-begin --flag-switches-end --restore-last-session Executable Path /Applications/Chrome.app/Contents/MacOS/Google Chrome Profile Path /Users/shivamgupta/Library/Application Support/Google/Chrome/Default Variations 84085631-ab02a1cf dff70c3e-377be55a .......,.

Copy the Executable Path to 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"
    }
]


来源:https://stackoverflow.com/questions/62620878/problem-to-run-chrome-debugger-in-vs-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!