You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
I am using Craft Nitro (https://getnitro.sh/) for local CMS development and connecting to the api using @vercel/fetch. Nitro provides URL's that look like https://testcms.nitro and updates the /ect/hosts file with that domain. However these domains do not resolve using @vercel/vetch
https://github.com/vercel/dns-cached-resolve special cases localhost, but It might be a good idea to allow a fallback to dns.lookup when dns.resolve fails to allow other domains defined in /etc/hosts to work. This could be an option set when setting up @vercel/fetch and it would allow enabling / disabling this behaviour depending on environment.
The text was updated successfully, but these errors were encountered:
I am using Craft Nitro (https://getnitro.sh/) for local CMS development and connecting to the api using @vercel/fetch. Nitro provides URL's that look like https://testcms.nitro and updates the /ect/hosts file with that domain. However these domains do not resolve using @vercel/vetch
It looks like this is happening because https://github.com/vercel/dns-cached-resolve is using dns.resolve4/dns.resolve6 both of which ignore the hosts file. Looking into the node DNS documentation it looks like dns.lookup uses the system DNS lookup which does look at /etc/hosts however there are performance implications when using it (https://nodejs.org/api/dns.html#implementation-considerations)
https://github.com/vercel/dns-cached-resolve special cases localhost, but It might be a good idea to allow a fallback to dns.lookup when dns.resolve fails to allow other domains defined in /etc/hosts to work. This could be an option set when setting up @vercel/fetch and it would allow enabling / disabling this behaviour depending on environment.
The text was updated successfully, but these errors were encountered: