diff --git a/packages/vite/src/node/http.ts b/packages/vite/src/node/http.ts index c2757f36477600..8710c274fd83d1 100644 --- a/packages/vite/src/node/http.ts +++ b/packages/vite/src/node/http.ts @@ -5,7 +5,6 @@ import type { OutgoingHttpHeaders as HttpServerHeaders } from 'http' import type { ServerOptions as HttpsServerOptions } from 'https' -import { promises as dns } from 'dns' import type { Connect } from 'types/connect' import { isObject } from './utils' import type { ProxyOptions } from './server/middlewares/proxy' @@ -187,13 +186,6 @@ export async function httpServerStart( ): Promise { let { port, strictPort, host, logger } = serverOptions - // This could be removed when Vite only supports Node 17+ because verbatim=true is default - // https://github.com/nodejs/node/pull/39987 - if (host === 'localhost') { - const addr = await dns.lookup('localhost', { verbatim: true }) - host = addr.address - } - return new Promise((resolve, reject) => { const onError = (e: Error & { code?: string }) => { if (e.code === 'EADDRINUSE') {