'Live Server extension not working when workspace is other than the current project
I am using the Live Server extension for VS code, but the problem is that when I write code in HTML, the browser does not reload automatically. i.e. I have to open the browser and refresh it manually to see the changes.
This whole thing was working fine when I was using VS Code, but since I have shifted to VS Code Insiders, the auto reload thing is broken.
PS. I have autosave turned on and I made no changes in the setting.
Edit: I have found out that the extension works correctly when the project folder is open as the root folder. But when I open one folder beneath the project folder (i.e. the workspace where I keep all my project folders), the extension breaks. Any way to make this work with a custom workspace root?
Solution 1:[1]
I've been trying to figure this out for 2 weeks now. And just fixed it today. I installed v5.6.1 and it didn't work. I'm using windows 10, 64 bit, Did some research and change some config with no luck. So I tried to downgrade the version to v5.6.0 and it worked! Hope this help.
Solution 2:[2]
I solved the problem openning the workspace file and putting first the serving folder on the list of folders:
Previous
{
"folders": [
{
"path": "folder-01"
},
{
"path": "folder-02"
},
{
"path": "folder-03"
}
],
"settings": {
"liveServer.settings.multiRootWorkspaceName": "folder-01"
}
}
Post
{
"folders": [
{
"path": "folder-02"
},
{
"path": "folder-01"
},
{
"path": "folder-03"
}
],
"settings": {
"liveServer.settings.multiRootWorkspaceName": "folder-02"
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | 4nOnym0vs |
| Solution 2 | Hector Daniel Colelia |
