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

6

9

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!

Eada answered 19/4, 2022 at 20:51 Comment(0)
T
5

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",
Tamikotamil answered 20/4, 2022 at 7:50 Comment(1)
Ah thank you, that's exactly the document I was looking for.Eada
M
1

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"

            }
        ]
Miniature answered 2/1 at 10:44 Comment(1)
Using this method, I can get it to work with opera. Thanks heaps!!Newell
P
0

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
Photography answered 4/11, 2022 at 12:19 Comment(0)
A
0

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

Antivenin answered 5/5 at 23:0 Comment(0)
L
-1

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

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

Looby answered 29/1, 2023 at 20:42 Comment(0)
T
-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.

Tove answered 7/6 at 8:3 Comment(1)
Please edit your answer to rewrite it in English.Cytogenetics

© 2022 - 2024 — McMap. All rights reserved.