javascripthtmlvisual-studio-codevscode-extensionsliveserver

How to fix a live server webpage that is opening but not being loaded in browser?


I have the live server extension installed in VS code and open up to a http://localhost:5500/ webpage. The contents of my HTML file are instead replaced by the following error message:

This site can’t be reached

The webpage at http://localhost:5500/ might be temporarily down or it may have moved permanently to a new web address.

And I cannot see my website.

I initially tried Googling around but the results addressed the issue of not being able to open up a webpage with the live server, whereas mine is being opened but not loaded.

Additionally, I am using WSL with VS code, but I don't know if that has anything to do with this issue.


Solution

  • After asking on The Odin Project's discord server, someone mentioned that I had to put:

    "liveServer.settings.port": 3000

    Into the live server's JSON settings file.

    Hope this helped someone else too!