diff --git a/packages/thirdweb/src/chains/utils.ts b/packages/thirdweb/src/chains/utils.ts index dc5c7b2c5d2..5cff2cdfb74 100644 --- a/packages/thirdweb/src/chains/utils.ts +++ b/packages/thirdweb/src/chains/utils.ts @@ -205,6 +205,7 @@ export function getChainDataForChain(chain: Chain): Promise { async () => { const res = await fetch(`https://api.thirdweb.com/v1/chains/${chainId}`); if (!res.ok) { + res.body?.cancel(); throw new Error(`Failed to fetch chain data for chainId ${chainId}`); } diff --git a/packages/thirdweb/src/utils/signatures/resolve-signature.ts b/packages/thirdweb/src/utils/signatures/resolve-signature.ts index 5363bfab7b1..22b9f327a9c 100644 --- a/packages/thirdweb/src/utils/signatures/resolve-signature.ts +++ b/packages/thirdweb/src/utils/signatures/resolve-signature.ts @@ -17,6 +17,7 @@ async function resolveFunctionSignature( `${SIGNATURE_API}/signatures/?format=json&hex_signature=${hexSig}`, ); if (!res.ok) { + res.body?.cancel(); console.log(res.statusText); return null; } @@ -39,6 +40,7 @@ async function resolveEventSignature( `${SIGNATURE_API}/event-signatures/?format=json&hex_signature=${hexSig}`, ); if (!res.ok) { + res.body?.cancel(); console.log(res.statusText); return null; }