Live server installed but not working in VS code
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.
First you can do is close the vs code
Go to the properties of My Pc
Click on Advanced Settings
click on Environmental Variables
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.
Sypder
Updated on July 09, 2022Comments
-
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?
-
Elias Schablowski almost 4 yearsIs this a large project, as in a lot of watched files, which might hinder the extension from watching the files (see unix.stackexchange.com/questions/13751/… for linux)
-
-
Avneet about 3 yearsFor 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 over 2 yearsSimple as it is. It works thanks !