Reputation: 21
When I am trying to open an HTML file with live server in VS code it
doesn't work and show me an error page
Error: connect ECONNREFUSED 127.0.0.1:8080
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
How can i fix it ?
Upvotes: 2
Views: 663
Reputation: 1517
You see the Live Server extension uses 5500 as a port, usually when such extensions are installed you need to restart VS code, have you tried to do that? Maybe restarting your entire machine would solve the problem, but anyway, have you tried to go to https://localhost:5500?
EDIT:
Set the browser for Live Server
It's possible that the extension is working, but your system doesn't have a default browser.
Even if you did set the default browser for your system, it wouldn't hurt to let Live Server know which browser you'd like to use explicitly.
First, open the Command Pallete with F1, then type in Preferences: Open Settings (JSON) and select that option.
This will open your VSCode settings.json file.
Scroll all the way to the bottom of the file, add a comma after the last setting, then paste in "liveServer.settings.CustomBrowser": "chrome"
Upvotes: 1