Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import crypto from 'node:crypto'
import { fileURLToPath } from 'node:url'
import type { ServerOptions as HttpsServerOptions } from 'node:https'
import { builtinModules } from 'node:module'
import { promises as dns, getDefaultResultOrder } from 'node:dns'
import { promises as dns } from 'node:dns'
import { performance } from 'node:perf_hooks'
import type { AddressInfo, Server } from 'node:net'
import fsp from 'node:fs/promises'
Expand Down Expand Up @@ -925,7 +925,10 @@ export function unique<T>(arr: T[]): T[] {
export function getLocalhostAddressIfDiffersFromDNS():
| Promise<string | undefined>
| undefined {
if (getDefaultResultOrder() === 'verbatim') {
// dns.getDefaultResultOrder is not available in bun 1.3.11 and deno 2.7.11
// while this is a bug in bun and deno, since this function is commonly called,
// we give a workaround specially until the API is supported in a few versions
if (dns.getDefaultResultOrder && dns.getDefaultResultOrder() === 'verbatim') {
Comment thread
sapphi-red marked this conversation as resolved.
return undefined
}
return Promise.all([
Expand Down