I have been trying to launch a html file in Visual Studio Code and I keep getting the message that the page is ‘online, but can’t connect’ (message from the trouble-shooter).
I have tried every solution suggested on the internet and have spent the whole day doing this, but still haven’t found the problem.
Do you have a <head> and the <body> in your HTML document?
Important: In order for Live Server to launch your HTML file, it must contain <head> and <body> tags. Without them, Live Server will not run your HTML file and display an error message.
how to set up, customize and use the Server
Right-click an HTML file in the project and choose “Open with Live Server” from the context menu.Do you have the error ?What is the error?
You might want to use a different port number than the default 5500.
I tried both, but neither worked. I don’t really know what I’m doing when it comes to ports/servers etc., I just read things and try to figure the bare minimum out. Would you be able to recommend a resource to learn about this stuff? In terms of figuring out the live server, I can’t really spend any more time on it after today. I don’t understand it either, because I had no problems using it last week.
VS Code Live Server Visual Studio Code Live Server Not Working
Open the browser console (usually accessible by pressing F12) and check for any error messages when trying to connect to the live server. This can provide insights into what might be going wrong.