question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] ConnectKit failing requests to Alchemy even though I am using Infura

See original GitHub issue

Describe the bug

I am using ConnectKit with Infura and until recently my website was working fine but now it fails to connect with a bunch of errors to Alchemy in the console.

To reproduce

I am using the following code to connect with ConnectKit:

import {
  WagmiConfig,
  createClient,
  useContractRead,
  chain } from "wagmi";
import { ConnectKitProvider, getDefaultClient } from "connectkit";

const contractConfig = {
  addressOrName: contractAddress,
  contractInterface: abiFile,
};

const client = createClient(
  getDefaultClient({
    appName: "Chublins",
    infuraId: process.env.INFURA_ID,
    chains: [chain.mainnet]
  }),
);

You can see the full source code of my website here: https://github.com/Montoya/chublins-website/tree/master

The page that used to work fine but now fails is here: https://chublins.com/view

Expected behavior

The view page should load without issues and allow you to enter an ID to view.

Screenshots

Screen Shot 2022-10-29 at 6 07 50 PM

Environment details

Latest Google Chrome on MacOS

Additional context

Like I said, this was working fine and then stopped working a couple weeks ago without any code changes.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lochiecommented, Nov 9, 2022

Left a big writeup on fixes, debugging and reasons for this issue over in https://github.com/family/connectkit/issues/33#issuecomment-1308935780

1reaction
lochiecommented, Nov 9, 2022

@Montoya You can check your clients provider configurations by using the useProvider hook and looking at the providerConfigs array to see what configured providers are going to be used. But you can’t see which one is currently being targeted.

I’ve talked with the people over at wagmi about it and there isn’t an easy way to check which provider is currently being targeted due to a limitation with the ethers library. If you feel the need to have this available you can always raise a discussion in the wagmi repo and see where things go from there.

I hope this helps resolve everything! I’m going to close this issue now but if anyone else is still having problems feel free to open your own tickets. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] connectkit (wagmi) is spamming alchemy #33 - GitHub
If your Infura/Alchemy key has not been passed through to the ... [BUG] ConnectKit failing requests to Alchemy even though I am using...
Read more >
Error Reference - Alchemy Docs
This generally means the transaction already posted and is on the node in a pending state. Sometimes this error occurs when transactions fail...
Read more >
Request failed or timed out - Questions - Infura Community
Hi, I am new to Infura and was trying to send requests with curl. ... fails with the message “{“jsonrpc”:“2.0”,“id”:1,“error…
Read more >
ethers.js - Use EthersJS to connect to either Alchemy or Infura ...
But I've recently discovered that my app was failing to an internal Alchemy server error, even though Infura seemed to be available at...
Read more >
CPY Document - Federal Trade Commission
of insurance" was next taken up by the Supreme Court in ... In other words even though the Connecticut Insurance Department was convinced...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found