question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Live Reload not working in Remote Window (WSL)

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:23
  • Comments:16

github_iconTop GitHub Comments

49reactions
ericuxnyccommented, Sep 14, 2021

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

3reactions
LeDragoXcommented, May 15, 2022

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.

Based on this answer, i’ve prepared the config to support 1 browser, you just need to uncomment your preffered browser:

{
  //"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
  //"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
  //"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe"
  //"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
  //"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Users/<<USERNAME>>/AppData/Local/Programs/Opera/opera.exe"
  //"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Users/<<USERNAME>>/AppData/Local/Programs/Opera GX/opera.exe"
}

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Live Server extension is not auto-reloading with WSL2
It seems WSL doesn't support live reload if the file is in another OS. Please refer the GitHub issue. The solution is to...
Read more >
Developing in WSL - Visual Studio Code
See the Remote Development and Linux article for details. Install Visual Studio Code on the Windows side (not in WSL).
Read more >
Remote WSL connection doesn't update Vue.js app on code ...
Create a new Vue.js project (or anything that support live reloading); Use WSL node.js instead of ... Haven't seen this problem when using...
Read more >
Livereload option not working on Windows 10 - Jekyll Talk
So, when starting the server : bundle exec jekyll serve --trace --livereload Configuration file: C:/Github/myrepo2/_config.yml Theme Config file ...
Read more >
Troubleshooting Windows Subsystem for Linux | Microsoft Learn
File a new issue. If you have found a problem with WSL and there does not appear to be an existing issue, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found