0

Hi I've got a problem to run Chrome Debugger directly in VS Code. I'm working on Linux Mint. This is how my launch.json file looks like:

{
// 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"
        
        
      
    }
]

}

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 chrome executable like this:

runtimeExecutable:"/opt/google/chrome/google-chrome" and now error message says:

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

  • do you have the chrome debugger installed? whats `pwa-chrome` ? it should be `chrome`if you have the chrome debugger installed – tHeSiD Jun 27 '20 at 14:11
  • Yes of course i have chrome debugger extension installed. When it comes to pwa-chrome, that was auto-genereted in launch.json file after installing extension. I also tried with value chrome but then a connnection tries to execute on localhost not a local file. – AdrianeZ - programuj Jun 27 '20 at 14:20

2 Answers2

2

I'm also using Chromium on Linux Mint. I solved the problem with

debug.javascript.usePreview: false in VS settings,

as explained in This answer

Fabio
  • 33
  • 8
  • `debug.javascript.usePreview` is no longer available starting from VSCode 1.60.0. Check out options on how to use the legacy debugger in [This answer](https://stackoverflow.com/a/69122112/1044637) – sorjef Sep 09 '21 at 17:02
1

You need to add the webroot property too try this

{
    "name": "Launch Chrome",
    "request": "launch",
    "type": "pwa-chrome",
    "url": "${workspaceFolder}/index.html",
    "webRoot": "${workspaceFolder}"
},
tHeSiD
  • 4,587
  • 4
  • 29
  • 49