Skip to content

Initializing EthereumProvider throws an error #3130

Discussion options

You must be logged in to vote

thanks @Slula, you need to move the init function inside the useEffect hook, this worked for me:

  useEffect(() => {
    const getWC = async () => {
      const walletCon = await EthereumProvider.init({
        projectId: "86acca839acf9cfaa0063dc9951984e5",
        chains: [1],
        methods: ["eth_signTypedData", "eth_signTypedData_v4", "personal_ecRecover"],
        showQrModal: true,
        qrModalOptions: {
          themeMode: "light",
        },
      });
      
      walletCon.on("display_uri", (uri) => {
        console.log("display_uri", uri);
      });
      
      setProvider(walletCon)
    }
    getWC();
  },[]);
  
  const connectWalletWC = async () => {
    provider.connect(

Replies: 11 comments 41 replies

Comment options

You must be logged in to vote
1 reply
@DragonmasterETH
Comment options

Comment options

You must be logged in to vote
1 reply
@TEE2DWHY
Comment options

Comment options

You must be logged in to vote
1 reply
@DragonmasterETH
Comment options

Comment options

You must be logged in to vote
3 replies
@TEE2DWHY
Comment options

@grahac
Comment options

@grahac
Comment options

Comment options

You must be logged in to vote
2 replies
@TEE2DWHY
Comment options

@grahac
Comment options

Comment options

You must be logged in to vote
2 replies
@TEE2DWHY
Comment options

@grahac
Comment options

Comment options

You must be logged in to vote
29 replies
@grahac
Comment options

@glitch-txs
Comment options

@DragonmasterETH
Comment options

@glitch-txs
Comment options

Answer selected by DragonmasterETH
@TEE2DWHY
Comment options

@DragonmasterETH
Comment options

@glitch-txs
Comment options

@DragonmasterETH
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@TEE2DWHY
Comment options

Comment options

You must be logged in to vote
1 reply
@grahac
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment