Max Duso
Max Duso

Reputation: 409

Visual Studio Code - Unable to launch Browser: "Unable to find an installation of the browser on your system."

An issue just recently developped while running scripts (any of my scripts in python, javascript,html...) within VS code. A popup comes up saying: Visual Studio Code - Unable to launch Browser: "Unable to find an installation of the browser on your system.Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json.

My browser is edge. When I open launch.json I see that it seems to be attempting to use chrome instead which I do not have downloaded on my computer.

{
    // 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",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        }
    ]
}

Can I change the configurations to match the browser I am running on my computer? Or is there something else I can Do to fix this problem?

Thanks!

Upvotes: 10

Views: 42189

Answers (6)

Миша Демин
Миша Демин

Reputation: 1

It can also work if you change "type":"Edge" to "type":"node"

At launch, I had Yandex, and in the launch file. There were only 2 json configurations, for Edge and Chrome.

In any of these configurations, replace type.

Upvotes: -1

Merilix2
Merilix2

Reputation: 564

This just happened to me after installing Ruby-LSP extension. Disabling the culprit extension helped.

Upvotes: 0

Abhishek
Abhishek

Reputation: 1120

If you use Chrome, Add runtimeExecutable key value pair in the object inside configurations in launch.json

"configurations": [
            {
                "type": "chrome",
                "request": "launch",
                "name": "Launch Chrome against localhost",
                "url": "http://localhost:3000",
                "webRoot": "${workspaceFolder}",
                "runtimeExecutable": "/path/to/chrome/executable"

            }
        ]

Upvotes: 1

Kevin
Kevin

Reputation: 99

you can just choose on the top to Chrome then it works

You can just choose on the top to Chrome then it works

Upvotes: -1

Jon
Jon

Reputation: 1180

I didn't have one of the browsers specified in

.vscode/launch.json

I hade two solutions availble to me:

  1. Changing the order (have an installed browser as first choice in the file)
  2. Install the missing browser

Upvotes: 0

Yu Zhou
Yu Zhou

Reputation: 12946

Yes, you need to change the configurations to launch Edge for debugging. You can refer to this doc. You need to change type to pwa-msedge:

"type": "pwa-msedge",

Upvotes: 5

Related Questions