Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 6975

`TypeError: fetch failed` while trying to use Connection in web3.js

$
0
0

When executing any call to via the Connection object I keep getting the error TypeError: fetch failed even though the RPC is up. How do I fix this?

import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js";const connection = new Connectio(clusterApiUrl("devnet"));const addr = new PublickKey('<SOME PUBKEY>');const balance = await connection.getBalance(address);

I would like to know how I can fix this one, is it because of my internet problem? Why can't I just connect to the rpc network, I can pick up airdrops.


Viewing all articles
Browse latest Browse all 6975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>