From 08147e6a86626b867a81cf30a3b9f62ce19022de Mon Sep 17 00:00:00 2001 From: Felipe Lalanne Date: Thu, 16 Dec 2021 11:37:35 -0300 Subject: [PATCH] Ensure happy-eyeballs uses supervisor dns lookup Happy-eyeballs performs [dns lookups](https://github.com/balena-io-modules/happy-eyeballs/blob/master/src/happy-eyeballs.ts#L23) for the requested addresses, however, because of the order of imports it was not using the supervisor custom `dns.lookup` that handles `.local` name resolution, making address resolution fail in those cases. Moving the import after the `dns.lookup` patch fixes the problem. --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 5842d8b5..ae22a3d3 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,6 +1,5 @@ import { NOTFOUND } from 'dns'; import * as mdnsResolver from 'mdns-resolver'; -import '@balena/happy-eyeballs/eye-patch'; class DnsLookupError extends Error { public constructor(public code: string = NOTFOUND) { @@ -118,6 +117,7 @@ interface DnsLookupOpts { }; })(); +import '@balena/happy-eyeballs/eye-patch'; import Supervisor from './supervisor'; const supervisor = new Supervisor();