Significa che Node sta tentando più connessioni in parallelo (A/AAAA, porte/indirizzi) e tutte falliscono; per questo solleva un AggregateError. Le funzioni internalConnectMultiple/afterConnectMultiple sono parte del modulo net di Node (Happy-Eyeballs / multi-connect). La causa reale è dentro l’array errors dell’AggregateError (es. ENOTFOUND, ECONNREFUSED, ETIMEDOUT, EHOSTUNREACH).
try { /* chiamata di rete */ } catch (e) {
console.error(e);
if (e.errors) console.dir(e.errors, { depth: 5 });
if (e.cause) console.dir(e.cause, { depth: 5 });
}
NODE_DEBUG=net node script.js
getent hosts api.expo.dev curl -4 -I https://api.expo.dev/graphql curl -6 -I https://api.expo.dev/graphql # se qui fallisce: IPv6 rotto
export NODE_OPTIONS=--dns-result-order=ipv4firstAggregateError.ECONNREFUSED), timeout (ETIMEDOUT), rete non raggiungibile (EHOSTUNREACH).localhost è il telefono (usa IP LAN o 10.0.2.2 sull’emulatore).export NODE_OPTIONS=--dns-result-order=ipv4first
unset HTTPS_PROXY HTTP_PROXY https_proxy http_proxy NO_PROXY no_proxy
node -e "require('https').get('https://together.apps.riseact.org', r=>console.log(r.statusCode)).on('error',e=>console.dir(e,{depth:5}))"
Curiosità: AggregateError in questo contesto incapsula tutti i tentativi falliti (per ciascun IP/porta). Guardare e.errors rivela l’errore “vero” senza dover riprodurre a mano tutti i casi.