Skip to content

Error: getaddrinfo ENOTFOUND localhost with vite when wifi is disabled #28611

@andykais

Description

@andykais

Related to this existing issue, which generated a similar error for different reasons #16643, I found a case where I cannot develop a vite app when my wifi is disabled.

$ deno --version
deno 2.2.3+f3e9325 (canary, release, x86_64-unknown-linux-gnu)
v8 13.4.114.11-rusty
typescript 5.7.3

Running arch linux, with a wlp4s0 wifi device.

repro

This can be accomplished when creating a default sveltekit app:

$ deno run -RWE npm:sv@latest create svelte-app

starting the app with wifi disabled creates the following error:

$ deno task dev
error when starting dev server:
Error: getaddrinfo ENOTFOUND localhost
    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:93:9)
    at __node_internal_ (ext:deno_node/internal/errors.ts:246:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (ext:deno_node/internal/dns/promises.ts:32:17)
    at ext:deno_node/internal_binding/cares_wrap.ts:71:9

additional details

This does not occur with a default vite app however. The following command will create a sample vite app (which uses a svelte app template, fwiw) Update: this information was incorrect. This issue still occurs with the default vite templates

deno run -RWE npm:create-vite-extra@latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions