vscode-live-server: Live Reload not working in Remote Window (WSL)
I’m submitting a…
[x ] 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
When using VS Code as a remote window connected to WSL (Ubuntu 18.04) the live reload feature of Live Server does not work.
Expected behavior
Live reload to work as it does when not in a remote window connected to WSL.
Environment
Browser:
- [x] Chrome (desktop) version 80.0.3987.163
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Live Server: 5.6.1 <!-- Check which version is installed -->
- Platform: Windows | Ubuntu 18.04 WSL <!-- Mac, Linux, Windows -->
- Visual Studio Code: 1.45.0-insider <!-- `code --version` -->
Others
When not using a remote window, the live reload feature works.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 25
- Comments: 25
To fix this issue go to Settings make sure you’re under Remote[WSL:“your linux distro”] and modify the Live Server>Settings: Advance Custom Browser CMD Line click edit in settings.json it should look like this: “liveServer.settings.AdvanceCustomBrowserCmdLine”: “/mnt/c/Program Files/Google/Chrome/Application/chrome.exe” change the path a needed for Firefox, Edge etc.
It seems the extension is looking within the OS for the browser as installing linux chrome also works, but under wsl its not too good so Id suggest th above fix or maybe adding chrome to the path for linux
Based on this answer, i’ve prepared the config to support 1 browser, you just need to uncomment your preffered browser:
Note - To reach the Opera browsers just rename
<<USERNAME>>
with your current username. Note² - The Firefox folder may vary depending on the source you’ve installed.Thanks from Brazil.
I solved it by looking for the local ip of my machine using ifconfig in the terminal, copy the ip, paste it in my browser and then :5500 (live server)
Thanks from México!
Hi, I’ve managed to finally get this to work:
Before that I had mistakenly linked the [liveServer.settings.AdvanceCustomBrowserCmdLine] to ‘Program Files’ when my browser was installed in ‘Program Files (x86)’, afterwards it managed to pop out and load the html, however it was not ‘live’…meaning I still had to refresh to see any changes.
After shifting my working files (which were in D drive) to the same directory (C drive /desktop) that the browser was installed in, it seems to be running fine.
-However, if you were to run it on the local drive ( not in WSL ) do note that the [liveServer.settings.AdvanceCustomBrowserCmdLine] directory might have to be edited for it to work on the local drive again, since it’s linked differently on WSL( /mnt/c/Program Files ) instead of local(C:\Program Files …)
Después de unas horitas, encontré esta solución: Vaya a Configuración, asegúrese de estar en Remoto [WSL: “su distribución de Linux”] y modifique Live Server> Configuración
Se modificara: “liveServer.settings.port”: 5500 Por defecto esta en el port 5500. Puedes cambiarlo a otro en mi caso solo puse 5501
Asegúrate que en la parte inferior derecha te salga el nuevo valor del puerto cuando lo ejecutes:
woked like charm
please add brave
"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe"