vscode-live-server
vscode-live-server copied to clipboard
live server is not opening browser
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
When I set the configuration file to open chrome rather than the default browser (which is edge in my case), the browser do not open when we start liveserver.
{
"liveServer.settings.CustomBrowser": "chrome",
}
So the server start but the chrome do not open. 👎
If I leave the settings empty, edge opens when I start liveserver 👍
Expected behavior
setting "liveServer.settings.CustomBrowser": "chrome"
should open the chrome when we start liveserver.
Environment
Browser:
- [x] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Live Server: v5.7.5
- Platform:
- W10
- WSL2
- Ubuntu 20.04.4 LTS
- Visual Studio Code:
- VSCODE 1.67.2
Others
I've tested multiple solutions:
- I've created an alias on wsl for chrome :
alias chrome="/mnt/c/Program\ Files/Google/Chrome/Application/chrome.exe"
but nothing change - I've used the setting
liveServer.settings.AdvanceCutomBrowserCmdLine": "chrome --remote-debugging-port=5500
but nothing change
When I try "liveServer.settings.AdvanceCustomBrowserCmdLine": "blabla"
nothing change and the server still starts at port 5500 (and not opening the browser) !
It seems that liveserver try to run the chrome but it can not find it.
A working workaround is to call chrome.exe installed under Windows directly in liverserver settings. With my configuration, the settings.json look like this:
{
"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --remote-debugging-port=9222",
}
Then when now when I run liverserver the chrome browser opens
Hope this can help
hi @lolorenzo777 where should i paste this json in the vscode ? { "liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --remote-debugging-port=9222", }
hi @Nikhilkumarravula
this is the settings.json
vscode setting file. It's either in your local repo or in the global config https://code.visualstudio.com/docs/getstarted/settings
I also face like this error and i paste "liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --remote-debugging-port=9222", in settings.json and still not working.The vs code said live server is working but chome does not open. I think, I face this problem after I had install mongodb to my laptop.Anyway if you have any solution for this can you tell me how can i fix this problem
"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
Have you checked where chrome is installed on your machine ?
On a WSL terminal screen you can try find /mnt/c -type f -name "chrome.exe" 2>/dev/null
to look where it is.
Adjust "liveServer.settings.AdvanceCustomBrowserCmdLine" with your entry.
Hope this help