Live server installed but not working in VS code

25,981

Solution 1

Re-install the extension and restart your text editor to fix the issue.

Solution 2

I had this problem and I solved it by changing the port number in the settings.json file to an opened one.

To get to the settings.json file you just click CTRL+SHIFT+P, then type "settings", click the "Preferences: Open Settings (JSON)", then paste this inside the { }:

"liveServer.settings.port": 0

This will randomly pick an opened port each time. This is how my JSON file looks like:

{
    "liveServer.settings.port": 0
}

If there are multiple lines in the JSON file, make sure each line is separated by a comma(,), like this:

{
    "liveServer.settings.CustomBrowser": "microsoft-edge",
    "liveServer.settings.port": 0
}

Solution 3

It is because you have added insufficient paths in your Environmental variables.

  1. First you can do is close the vs code

  2. Go to the properties of My Pc

  3. Click on Advanced Settings

  4. click on Environmental Variables

  5. from there you can add path clicking the path variables in the table shown there 6 . Add a new line to the path and copy paste the path of your system 32

C:\Windows\System32

hope this solution works in your case

Solution 4

If live server is not runnning and rendering html page on port 5500,for example http://127.0.0.1:5500/index.html not working.

Then this may be due to connection issue on your system.

I had same problem when i was compiling below html page:

<!DOCTYPE html>
<html>
<body>
    <h1>Hello world</h1></body>
</html>

Solved it by changing live server settings to my local IP and it fixed issue.

My local ip: http://192.168.2.16:5500/index.html is rendering changes on fly and working.

For steps, you can refer: https://www.youtube.com/watch?v=_B3RRVhgCOw

This works for anyone for whom live server is not running by default with port 5500.

Share:
25,981
Sypder
Author by

Sypder

Updated on July 09, 2022

Comments

  • Sypder
    Sypder almost 2 years

    I have installed the live server extension but the browser does not update after I save my HTML or other files. What might be causing a problem?

  • Avneet
    Avneet about 3 years
    For such issues, refer settings.json file in vs code. { "liveServer.settings.useLocalIp": true, "liveServer.settings.CustomBrowser": "chrome" } Also if you are behind company firewall, this method might not work and you need to get it opened.
  • doob
    doob over 2 years
    Simple as it is. It works thanks !