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

Metamask SDK not working properly --added minimal reproduction #4367

Closed
1 task done
kr-keshav-kk opened this issue Oct 28, 2024 · 3 comments
Closed
1 task done

Metamask SDK not working properly --added minimal reproduction #4367

kr-keshav-kk opened this issue Oct 28, 2024 · 3 comments
Labels
Needs Reproduction Misc: Needs Reproduction

Comments

@kr-keshav-kk
Copy link

kr-keshav-kk commented Oct 28, 2024

Check existing issues

Describe the bug

I am using vanilla js of wagmi with svelte kit.

I have implemented coinbase and walletConnect sdk and they are working fine.
But for metamask i have to call this function twice (calling it even number of times, it works).
First time clicking gives this warning:
MetaMaskSDK: No active provider found
image
Next time it upon clicking it works as expected.

This is the function that i have to call twice
await connect(wagmiConfig, { connector:metaMask() });

Link to Minimal Reproducible Example

https://stackblitz.com/edit/sveltejs-kit-template-default-2piuac?file=src%2Froutes%2F%2Bpage.svelte

try npm ci if it stackblitz is not able to run the website

Steps To Reproduce

wagmiConfig = createConfig({ chains: supportedChains, connectors: [ metaMask(), coinbaseWallet(), walletConnect({ projectId: PUBLIC_WALLET_CONNECT_ID, }), injected(), ], transports: supportedTransports, });

the next part is inside button click:

`await connect(wagmiConfig, {
		connector:metaMask(),
	});`

What Wagmi package(s) are you using?

@wagmi/connectors, @wagmi/core

Wagmi Package(s) Version(s)

"@wagmi/connectors": "^5.2.1", "@wagmi/core": "^2.13.8",

Viem Version

"viem": "^2.21.27"

TypeScript Version

"typescript": "^5.6.3",

Anything else?

No response

@tmm tmm added the Needs Reproduction Misc: Needs Reproduction label Oct 28, 2024
Copy link
Contributor

Hello @kr-keshav-kk.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
@kr-keshav-kk kr-keshav-kk changed the title Metamask SDK not working properly Metamask SDK not working properly --added minimal reproduction Oct 28, 2024
@kr-keshav-kk
Copy link
Author

@tmm can you check again?? I have added minimal reproduction

@kr-keshav-kk
Copy link
Author

can someone reopen this issue? I have added the minimal reproduction code.
@1997roylee @tmm @jxom

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

No branches or pull requests

2 participants