Giao Tran
Giao Tran

Reputation: 155

How come I can't open my .html with Live Server in VS Code when I haven't opened a parent directory of it as a workspace folder?

I installed Live Server in VS Code for the first time and am trying to open an .html file with Live Server. I'm following the simple instructions provided here on the official installation page, but to no avail.

I right-click my file in the Explorer as instructed, but "Open With Live Server" doesn't show. I've even tried right-clicking the tab and that doesn't work either. I've quit and re-started VSCode and that didn't work. I set Chrome as my default browser in settings.json and that didn't work. I double checked to make sure Live Server is installed and enabled globally and it is. Please help me figure out what's going on! Thank you!

Right clicking my file under Open Editor Right clicking the file tab Live Server is indeed installed

Upvotes: -1

Views: 10632

Answers (2)

dogteeth
dogteeth

Reputation: 106

It's happened to me few times. My problem was the folder and files names. Check those names and don't use spaces or weird characters.

Upvotes: 1

Giao Tran
Giao Tran

Reputation: 155

Oh! I figured it out. I had to open my file by selecting "Open Folder" and then open my folder from there. Then I was able to select my file under the Explorer tab and right-click to open with Live Server. I'm not sure why it worked that way. enter image description here

Upvotes: 1

Related Questions