Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Live server not refreshing browser

I'm using live server extension in Visual Studio Code, and it's doesn't work. What i mean about "doesn't work" is that it doesn't refresh the broswer after modifications of the code but i can open it. The only way to see the modifications is to close it and open it again...

What i tried :

-Make chrome as the default broswer but it's already. -Reinstall VS code.

What i tried but failed :

-Edit the code for making chrome the default broswer in the code but i have a error "cannot edit in read only editor" that i can't fix it.\

Installed extensions : Code runner - HTML CSS Support - Live Sass compiler - Live server - Monokai Pro (themes).


2 Answers

For me the problem was in .html file missing the

<head><meta charset="UTF-8"></head>

Adding it resolved the issue.

like image 121
Jamato Avatar answered Dec 23 '25 19:12

Jamato


I found it! I spent many hours trying to find the solution. I followed your steps but it didn't change something during the refreshing of the page.

I tried to change the setting.json, uninstall and install the vs code (insider and classic) again, delete and open a new account in GitHub, and see many videos but it remained the same; each change in HTML or CSS didn't appear on the page when I refreshed it.

So, I followed your steps about the Line Server and nothing changed but I kept them. I ended up searching the settings on the visual studio code.

  1. Open ⚙️
  2. Choose "Settings"
  3. In the section "Commonly Used", find the option "Files: Auto Save" (the first option on 08/09/2022)
  4. Open the menu of options and confirm the "afterDelay"
like image 28
nik_kaz Avatar answered Dec 23 '25 20:12

nik_kaz