fix(core): conditionally include hostname parameter when using… (#9407)

This commit is contained in:
Jack Robson 2024-01-18 13:03:45 +00:00 committed by sebastien
parent a2c8b4185b
commit bd1a2aa3c5

View file

@ -54,7 +54,10 @@ async function choosePort(
defaultPort: number,
): Promise<number | null> {
try {
const port = await detect({port: defaultPort, hostname: host});
const port = await detect({
port: defaultPort,
...(host !== 'localhost' && {hostname: host}),
});
if (port === defaultPort) {
return port;
}