Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection declined. Connection can be declined if a previous request is still active #4311

Open
Ay7ot opened this issue Mar 9, 2024 Discussed in #4310 · 5 comments
Open

Comments

@Ay7ot
Copy link

Ay7ot commented Mar 9, 2024

Discussed in https://github.com/orgs/WalletConnect/discussions/4310

Originally posted by Ay7ot March 9, 2024
This is my first time working with Web3Modal and I'm using react. I'm running into a kind of bug. When Itry to connect from a mobile browser or a browser that doesn't have an extension installed, i get the error Connection declined. Connection can be declined if a previous request is still active.
My Context provider code looks like this:
`import { createWeb3Modal } from '@web3modal/wagmi/react'
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config'
import { injected, metaMask, safe, walletConnect } from 'wagmi/connectors'
import { WagmiProvider } from 'wagmi'
import { arbitrum, mainnet } from 'wagmi/chains'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

// 0. Setup queryClient
const queryClient = new QueryClient()

// 1. Get projectId at https://cloud.walletconnect.com
const projectId = 'MY_PROJECT_ID'

// 2. Create wagmiConfig
const metadata = {
name: 'Web3Modal',
description: 'Web3Modal Example',
url: 'http://localhost:5173', // origin must match your domain & subdomain
icons: ['https://avatars.githubusercontent.com/u/37784886']
}

const chains = [mainnet, arbitrum]
const config = defaultWagmiConfig({
chains, // required
projectId, // required
metadata, // required

enableWalletConnect: true, // Optional - true by default
enableInjected: true, // Optional - true by default
enableEIP6963: true, // Optional - true by default
enableCoinbase: true, // Optional - true by default

})

// 3. Create modal
createWeb3Modal({
wagmiConfig: config,
projectId,
enableAnalytics: true // Optional - defaults to your Cloud configuration
})

export function ContextProvider({ children }) {
return (

{children}

)
}`

I basically followed the doc on installation and I dont know why this is happening.
My button is in my app folder and yes, i wrapped my App in ContextProvider.

@0xSzeth
Copy link

0xSzeth commented Apr 17, 2024

Any update on this? Currently experiencing the same error.

@ifeoluwaayo
Copy link

Having this same issue

@imjakechapman
Copy link

Literally dealing with same thing right now. I have no connection windows open or anything.

@yaman1337
Copy link

I'm also facing the same problem.

@socheatleang
Copy link

We are on the same league. Waiting hero to come now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants