Open davepacheco opened 1 year ago
Cool. Seems like this might be fixed in Remix v2, which I am in the process of upgrading to in oxidecomputer/rfd-site-old#238.
It might always use localhost
in dev mode:
I checked and v2 does not fix this, it does the same thing.
~/oxide/rfd-site $ HOST=abc LOCAL_RFD_REPO=~/oxide/rfd npm run dev
> dev
> remix dev
💿 remix dev
info building...
info built (4.3s)
Error: getaddrinfo ENOTFOUND abc
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
What do you think it should be doing instead? Do you think local dev should always use localhost
regardless of the value of HOST
? If so, here's the stupid fix we could go with (I don't really see an issue with it):
- "dev": "remix dev",
+ "dev": "HOST=localhost remix dev",
~/oxide/rfd-site $ HOST=abc LOCAL_RFD_REPO=~/oxide/rfd npm run dev
> dev
> HOST=localhost remix dev
💿 remix dev
info building...
info built (4s)
[remix-serve] http://localhost:3000 (http://localhost:3000)
I checked and v2 does not fix this, it does the same thing.
~/oxide/rfd-site $ HOST=abc LOCAL_RFD_REPO=~/oxide/rfd npm run dev > dev > remix dev 💿 remix dev info building... info built (4.3s) Error: getaddrinfo ENOTFOUND abc at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
What do you think it should be doing instead? Do you think local dev should always use
localhost
regardless of the value ofHOST
? If so, here's the stupid fix we could go with (I don't really see an issue with it):- "dev": "remix dev", + "dev": "HOST=localhost remix dev",
That seems fine. I don't know enough about Remix to have much opinion. A lot of stuff assumes that a system's hostname is resolvable in DNS, but that's generally not a great assumption. Usually if I want something to listen on anything other than localhost
, I want to tell it exactly what. In that sense, I'd rather it didn't look at HOST
at all, but 🤷 maybe for most users that's what they want.
I would also be happy with an error message that said that it failed to come up because of this (and ideally where it got the hostname from) and then exiting instead of just hanging. The real reason this was annoying was that I spent time trying to guess if it came up anyway (I noticed it did open port 3001 and tried that) and also guessing where it got zathras
from. But it seems like fixing these issues is probably harder than just telling it to use localhost.
Thanks for looking at this!
On my system,
HOST=zathras
(in the environment). Butzathras
is not resolvable in DNS. If I run this, it reports this error and then sits there, not having started listening on port 3000:I was confused about whether this problem was fatal or not. It seems like it basically is but the program doesn't exit. I worked around it by setting HOST=zathras.local.