yaak
yaak copied to clipboard
🐞 Yaak silently crashes/fails to launch if `localhost` can't be resolved
I was trying to launch Yaak on macOS, and the app was failing to start with no indication of why, not even in Console.app
.
Building from source revealed that the app was exiting early as follows:
$ npm run tauri-before-dev
> [email protected] tauri-before-dev
> npm run --workspaces --if-present dev
> @yaakapp/[email protected] dev
> vite dev --force
♻️ Generating routes...
✅ Processed routes in 591ms
error when starting dev server:
Error: getaddrinfo ENOTFOUND localhost
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:internal/dns/promises:86:17)
npm error Lifecycle script `dev` failed with error:
npm error code 1
npm error path /Users/dougstephen/Developer/Workspaces/Personal/git/yaak/src-web
npm error workspace @yaakapp/[email protected]
npm error location /Users/dougstephen/Developer/Workspaces/Personal/git/yaak/src-web
npm error command failed
npm error command sh -c vite dev --force
The underlying issue turned out to be that an external process had mucked up my /etc/hosts
file, making localhost
unresolvable.
While it does seem to be a rather unlikely setup to have localhost
fail to resolve, still probably worth seeing if there's a reasonable way to avoid crashing here. Or maybe even falling back to 127.0.0.1
if the hostname isn't hardcoded somewhere upstream.