camudo
camudo3mo ago

Sometimes a weird error happens when deno is downloading dependencies

Hello! I have seen some people (including myself) encountering this error after updating deps in deno.json then running deno run. Import 'https://registry-staging.deno.com/@deno/cache-dir/meta.json' failed: error sending request for url (https://registry-staging.deno.com/@deno/cache-dir/meta.json): error trying to connect: dns error: Unknown host (os error 11001) The error seem to go away if you try to run it a few times but... I dont really understand what is causing it. Do any of you guys know what could be happening? Btw: I am not behind any corporate proxy or something like that.
2 Replies
camudo
camudo3mo ago
Apparently started happening in the last 2-1 weeks or so
Deno AI Helper
Deno AI Helper3mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with DNS resolution when Deno is trying to download the dependencies. The error message indicates that the host name registry-staging.deno.com could not be resolved, which is why you're seeing a DNS error with Unknown host (os error 11001). This could be due to a temporary issue with your internet connection, the DNS service you're using, or the Deno registry itself. Since you mentioned that the error goes away if you try to run it a few times, it's possible that the DNS resolution eventually succeeds, which allows Deno to connect and download the dependencies. Here are a couple of things you could check or try: 1. Make sure that your internet connection is stable. 2. Try using a different DNS server, such as Google's 8.8.8.8 or Cloudflare's 1.1.1.1, to see if the issue persists. 3. Ensure that there are no typos in the URLs within your deno.json file. 4. Check if there's any intermittent issue with the Deno registry by visiting the URL in a web browser or using a tool like curl. Please note that this advice is not based on the Deno documentation, and you should double-check the accuracy of the advice given. If the problem continues, you might want to reach out to the Deno community for further assistance or check if there are any ongoing issues with the Deno registry that could be affecting dependency downloads.