Skip to content
При запуске локального сервера в среде VS code с использованием плагина Live Server появляется ошибка
Open a folder or workspace… (File -> Open Folder)

Для устранения ошибки в VS code переходим в проводник и жмем Открыть папку, далее указываем путь до файла index.html, жмем Ок.

Далее появится информационное окно
Вы доверяете авторам файлов в этой папке?
Code предоставляет функции, которые могут автоматически выполнять файлы в этой папке.If you don’t trust the authors of these files, we recommend to continue in restricted mode as the files may be malicious. See our docs to learn more.
С:site Доверять авторам всех файлов в родительской папке «с:»
Ставим галочку и жмем Да, я доверяю авторам

Далее автоматически откроется проект

и переходим в Open with Live Server

откроется браузер по умолчанию (как изменить браузер по умолчанию см. здесь) 127.0.0.1:5500/index.html


1634
«Open a folder or workspace… (File -> Open Folder)» when «> Live Server: Open with Live Server» without a folder being open
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release) [X ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [X ] Feature request [ X] Documentation issue or request [ ] Other: <!-- Please describe: -->
Current behavior
With a HTML page open, I hit Ctrl+Shift+P and type Live Server: Open with Live Server but I get a error saying Open a folder or workspace… (File -> Open Folder)
Expected behavior
Should open a standalone HTML file.
Environment
Browser: - [ ] Chrome (desktop) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [X ] IE version 11 - [ ] Edge version XX For Tooling issues: - Live Server: Latest - Platform: Windows - Visual Studio Code: 1.29.1
Others
Hi I was just wondering if you were able to solve this issue? I am experiences the same error.
Guys hello, i have the same problem but i could not solve it.
When i press Open with live server below message appears «Open a folder or workspace… (File -> Open Folder)», I opened any html file there many times but nothing about live server works ,guys how can i solve this?please any help
Kind Regards
hi
Want to known how to open more than one html file using live server in visual studio code
And when i try open more than one file with live server it is opening that files on same port, but when try to close live server for one file it is closing for all files opened on that port
So please tell me how to use live server for multiple files in visual studio code
I’m facing the same issue can anybody help me please!
«Open a folder or workspace… (File -> Open Folder)»
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
it really works……………
Will you please attach screenshot or write your issue which you are facing?
It will help me to understand related problem
…
Thanks, but It worked with the help of your previous answer.
Didn’t work for me 🙁
Try doing «ctrl O» and then open the file. This will solve it. You might have seen «Not Opened In Folder» notification
go to file>open folder> then open the folder where .html file is saved dont open the file just open the folder
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
sry but i cant understand please can you helped me to solved this prob…….
Wow! I got the solution,
whenever you try to open file without opening folder in visual studio code, then the issue occurs, to avoid this first open the folder(where code file already exist) in visual studio code, and then you can open live server by right click.
thank you
thankyou pihu01 its working ……….
thanks alot….
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release) [X ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [X ] Feature request [ X] Documentation issue or request [ ] Other: <!-- Please describe: -->Current behavior
With a HTML page open, I hit Ctrl+Shift+P and type Live Server: Open with Live Server but I get a error saying Open a folder or workspace… (File -> Open Folder)
Expected behavior
Should open a standalone HTML file.
Environment
Browser: - [ ] Chrome (desktop) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [X ] IE version 11 - [ ] Edge version XX For Tooling issues: - Live Server: Latest - Platform: Windows - Visual Studio Code: 1.29.1Others
Open your folder in Vscode explorer
the same question occured,can anybody help me figure it out ? 3q
Vscode>File>Open folder >»choose the folder where you saved .html file.
then click on «alt+alt+o» to start live server.
i can make a short video if you cant understand me.
yep,i understand,i had try to find out folder,but it doesn’t work finally.I am so much appreciated if you could send me the video.
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->
Current behavior
I am new to Visual Studio Code and to writing code. VSC is working perfectly. Sadly, after installing and activating the Live Server extension I get an error when trying to start it in a browser. The error message is: Open a folder or workspace… (File -> Open Folder)
All I am doing is working on HTML and CSS. If I open the HTML page in Chrome, I can update it by using cmd tab and cmd r.
I uninstalled the extension and updated the version of VSC. I then reinstalled the LS extension and get exactly the same result.
Expected behavior
The VSC HTML page I’m working on would open in Chrome and instantly update as I make changes.
Environment
Browser:
- [X ] Chrome (desktop) Version 69.0.3497.81 (Official Build) (64-bit)
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Live Server: 5.1.1
- Platform: Mac OS High Sierra version: 10.13.6
- Visual Studio Code: Version 1.27.1 (1.27.1)
Others
I tried installing another extension: Live Server Preview 0.1.2 and couldn’t get this to work either. I have also searched YouTube and GIT for a solution but had no luck.
The extension won’t work if you only have a file open. Use ‘File -> Open Folder’ in VSCode to open the directory your files are in. Then open the respective HTML file. You can start Live Server now and it should work.
You are quite correct. IT WORKS!! Thank you for providing this simple yet effective solution.
I was having this issue, then followed the above. I got the ‘Go Live’ button to show up, but now when press it it shows this error:
«Something is went wrong! Please check into Developer Console or report on GitHub.»

However when I check to find an error there is none to be found?
Hello people,
unfortunately my browser does not open automatically. I have already selected «Chrome» in the settings, yet without success. Is there a mac os setting that I need to make? It works via the manual path in the browser.
Thanks in front,
many greetings
Sascha
У меня была такая же проблема в Windows, когда я ранее создавал разные проекты в неопределенной рабочей области (рабочее пространство VSCode по умолчанию).
Когда я создаю рабочее пространство и помещаю свои корневые папки в это одно рабочее пространство, он предупреждает, что не может разрешить папку рабочего пространства.
Вам необходимо отредактировать файл конфигурации рабочего пространства, изменить путь к папкам, а затем перезапустить VSCode.
На палитре команд VSCode введите: конфигурация рабочей области — затем выберите «Открыть файл конфигурации рабочей области».
У вас должно получиться что-то вроде этого:
{
"folders": [
{
"path": "OneProject"
},
{
"path": "AnotherProject"
}
],
"settings": {}
}
Вам нужно что-то вроде этого:
{
"folders": [
{
"path": "C:/Somewhere/OneProject"
},
{
"path": "C:/Somewhere/AnotherProject"
}
],
"settings": {}
}
Это известная проблема, здесь ее исправили — https://github.com/Microsoft/vscode/issues/50866
В версии 1.24.1 он еще не доступен. Но перечисленное выше исправление должно устранить возникшую у вас проблему.
I am using VS code for react. I have the live server extension installed, whenever I try to go live with VS code it shows me a listing directory with all of my folders and files in the browser instead of running my app. Any clue as to why it does this?
Gama11
30.3k9 gold badges72 silver badges97 bronze badges
asked Mar 9, 2019 at 1:10
![]()
LiveServer will load the file within the folder in the WORKSPACE assigned to it.
So point to the correct folder and more important, CLOSE active WorkSpaces already opened with LiveServer.
So…
Open the Explorer on VSC and close any open «Workspaces» (save your work)
Target the correct index.html file in a new Workspace.
Once it points to the right file then simply right-click and select «open with LiveServer.»
It should work.
answered Jun 29, 2020 at 12:21
ORMICAORMICA
611 silver badge1 bronze badge
Just had this error, you have to open the folder using «open folder». It’ll be in the editor panel now. And when you go live it takes you to whatever is in the editor panel.
answered Mar 20, 2021 at 0:41
1
You should have a dedicated folder for the file(index.html) to run the code directly in the browser from VS code Live Server.
answered Feb 28, 2020 at 2:48
0
Пока что в VS Code можно открыть только один workspace (рабочее пространство) в котором (до недавнего времени) можно было открыть только один каталог с проектом
Теперь стало доступно открыть сразу несколько каталогов
Например, я пишу свой шаблон для проектов, в нем есть api-сервер, есть client у них обоих есть еще и ядра, а еще есть документация ко всему этому в итоге у меня уже 5 репозиториев
Все это мне нужно одновременно открыть и работать, вот для этого и сделан multi-root folders
В итоге я могу открыть сразу все 5 репозиториев и работать с ними, делать коммиты и отправлять их в GIT как будто они все открыты отдельно
Иначе мне пришлось бы открывать несколько окон vs code и переключаться между ними
P.S. Сейчас вот многие ждут когда сделают возможность открывать несколько рабочих пространств (workspaces) чтобы каждый каталог открыть в своем пространстве, это нужно чтобы код не конфликтовал между собой
Для примера опять же возьмем мой проект (он написан на php), есть ядро в котором есть разный код и библиотеки, это ядро подключается в api-сервер в качестве библиотеки в итоге в одном пространстве vs code видит сразу несколько одинаковых файлов, один и те же файлы находятся в двух каталогах (в ядре и в api-сервере), чтобы это жестко разделить и нужен multiple workspaces