I have two html files, both identical apart from the titles and a couple of style variations on a video. Very basic. I’m like one hour into the course, total beginner.
So one will open with live server on Chrome while the other won’t. In theory they should both open.
I currently have port set to 0 because default port was having the same problem and I was following some advice via a google search. I have Live server extension installed, (uninstalled and re-installed) ,re-booted VS Code and all the typical checks. Still can’t figure it out.
I have a simple boiler plate copied and pasted as a starter.
I’ve tried creating new html documents and none of them will open with live server. It will only open the one html document like it’s stuck on it.
Im on Mac OSX 11.5.2 and installed the latest VS Code today which is working horribly for me.
Welcome to the community @PhilWilkinson.
I never have to open 2 html files using the F5 keystroke.
My assumption before I ever tried is it is by design. So nothing isn’t problematic on your side. I meet the same behaviour.
As for why it happens, I believe it is simply because you are working into 1 IDE which have 1 debugger at a time.
You can still open both files manually in your browser.
Now I understand that for the sake of convenience, you’d like to be able to open both files in a browser.
I don’t have sufficient VS Code configuration knowledge to directly provide the answer but I did a quick search and there seem to be an Open in Browser extension for that.
Hi thanks for the quick reply!
Actually it’s not about having two files open at the same time. The problem is even if I reboot VS the bad file still won’t open in live server even by itself, so I don’t have enough experience to know what that could be.
It does work if I run it straight from the folder and then I can edit the code in VS and refresh Chrome each time to see the result but that defeats the objective of having the the live server extension.
I’ve deleted some file and started again and then it works, then when I make some other files it stops working again. I’m creating files for each section of the course for my own reference as I go without having one huge file with everything in one place. Seems that VS is just very buggy, there are other things that are not working either but are for another topic. Thanks!
I think I figured it out.
I was using spaces between words in the file names and VS didn’t like it. I added underscores between each word and now all files open with live server. So problemo solved :0)
Huge learning curve for me but fun!