Skip to content

Commit

Permalink
Fix issue with opening wrong URL when address is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentHagu committed Mar 5, 2025
1 parent b62d17b commit 40f8f52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/lib/live-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ LiveServer.start = function(options) {
} else if (e.code === 'EADDRNOTAVAIL') {
console.log('%s is not available. Trying another address'.yellow, host);
setTimeout(function() {
server.listen(port, '127.0.0.1');
host = "127.0.0.1";
server.listen(port, host);
}, 1000);
}
else {
Expand Down

0 comments on commit 40f8f52

Please sign in to comment.