-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Error 'Unable to lauch browser: "Unable to attach to browser"' after every update #296237
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: many versions, up to and including 1.109.3
- OS Version: Windows 11 23H2
Steps to Reproduce
- Create a
launch.jsonsimilar to this, at least typemsedgeandchromeare affected:
{
"name": "Launch Edge",
"request": "launch",
"type": "msedge",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}- Update Visual Studio Code
- Restart Visual Studio Code the first time after updating. Try to launch the browser with F5. The error
Unable to launch browser: "Unable to attach to browser"will appear:
- Restart Visual Studio Code a second time. Launching the browser with F5 works again.
Previous reports
This issue has been previously reported in #239705. The issue was closed due to an automatically applied info-needed tag that has not been removed. There's a lot of confusion in the comments - because of the nature of the issue, doing anything can seem like it fixed the issue, when in reality it was just the restart of VS Code.
It was reported again in #255774, although the reporter didn't realize the real cause of the issue and closed it again.
Additional information
Because the issue only appears once after each update of VS Code, it is intermittent and hard to reproduce.
Gathering info from the comments of the previous issue and my personal setup, the bug might only occur when VS Code is installed globally (with admin rights) while the user launching VS Code does not have admin rights. It might be specific to Windows.