How to Fix the Puppeteer Error in Visual Studio 2022

This may be one of the strangest errors I got from Visual Studio 2022 (17.6.3) in a long time:

ERROR One or more errors occurred. Unable to launch browser: 'Failed to launch browser! TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md'

I got this error when I tried to start our web application in debug mode. It worked without any problem for a long time and that error only happened on my machine – everyone else in the team could run it in debug mode without any problems. It also only happened with Chrome, other browsers like Edge worked as expected.

After an annoyingly long time, I could identify the trigger for this error. In the launchsettings.json we added months ago the inspectUri property to debug the Blazor application:

With this line I now got the error above, without the line everything worked as expected. To fix the problem for now we decided to “comment out” the property by appending two _:

Should you run into an error about Puppeteer, check if you have a similar setting in the launchsettings.json file.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.