I’ve installed Visual Studio Code – Live Server Extension and did all the required steps. The Live Server is starting but it isn’t opening in the browser when I click "go live". If I manually go on browser it is working.
I set the default browser and did all required settings in setting.json file too, but it still doesn’t work.
2
Answers
Update the new version of Visual Studio
First, install the live server extension. If you did install it, then check your internet connection and restart your VS code. If the issue stays the same, check that you have set the default browser for your operating system. It’s possible that the extension is working, but your system doesn’t have a default browser.
Define Live Server and let it know which browser you’d like to use explicitly.
First, open the Command Palette with
F1
, then type in Preferences: OpenSettings (JSON)
and select that option.This will open your VS Code
settings.json
file.Scroll all the way to the bottom of the file, add a comma after the last setting, and then paste in
"liveServer.settings.CustomBrowser": "chrome"
:Note that you can also use
"firefox
,""safari"
, or any other browser as the value for the"liveServer.settings.CustomBrowser"
setting.Finally, save the
settings.json
file and try to run Live Server again.Here is a link that may help you:
free code camp’s article