Reputation: 1
SOLVED: I needed to install WSLU in VS code and set my default browser in liveserver settings.json to "wslview".
I recently setup WSL2 using Ubuntu 22.04 on my laptop running windows 11. When I first tried live server in VS Code, it gave me a pop up that said something like "Would you like to open in browser?". I would hit yes and it worked, but it wouldn't ever open automatically like when I hit "Go Live" using a file just on my local files, i.e. not using WSL. (I think I accidentaly clicked "Don't Show Again", and no matter what settings I change I haven't seen this pop up again.)
I know this has been asked before, but I still can't find a solution. I think it's a problem with WSL not connecting to chrome rather than a problem with VS Code or Live Server as I'm pretty sure my Live Server settings are correct to automatically open up chrome. For reference, here is my settings.json file for Live Server.
Remote[WSL: Ubuntu-22.04] settings.json
{
"liveServer.settings.CustomBrowser": "chrome",
"liveServer.settings.AdvanceCustomBrowserCmdLine": "",
"liveServer.settings.ChromeDebuggingAttachment": false,
"liveServer.settings.port": 5500,
"liveServer.settings.host": "127.0.0.1",
"liveServer.settings.root": "/",
"liveServer.settings.useLocalIp": true,
"liveServer.settings.NoBrowser": false,
}
I have also read this thread: https://github.com/ritwickdey/vscode-live-server/issues/65 and it doesn't seem to work. Maybe becasue my issue is with WSL and not just windows?
What am I missing? How can I use WSL and use Live Server?
Upvotes: 0
Views: 45