WalletConnectProvider is not a constructor
See original GitHub issueHello guys,
I’m following example from npm
page, but I get this error.
Am I missing something?
import Web3 from "web3";
import WalletConnectProvider from "@walletconnect/web3-provider";
// Create WalletConnect Provider
const provider = new WalletConnectProvider({
infuraId: "27e484dcd9e3efcfd25a83a78777cdf1", // Required
});
// Enable session (triggers QR Code modal)
await provider.enable();
// Create Web3
const web3 = new Web3(provider);
const provider = new WalletConnectProvider({
^
TypeError: WalletConnectProvider is not a constructor
at file:///home/luke/repos/dx/test/index.mjs:5:18
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
e is not a constructor - WalletConnectProvider model not ...
i have fixed the problem, by adding const WalletConnectProvider = window.WalletConnectProvider.default; inside constructor().
Read more >e is not a constructor - WalletConnectProvider model not ...
The problem is in this file (LaravelWeb3Scripts.php/walletconnect.ts) - this file is the one used for getting providers models. Vendor/Provider ...
Read more >WalletConnect is not a constructor, react native - Moralis Forum
Today I cloned the project and installed it on my ios device. The app installed correctly but when I try to click on...
Read more >TypeError: "x" is not a constructor - JavaScript - MDN Web Docs
The JavaScript exception "is not a constructor" occurs when there was an attempt to use an object or a variable as a constructor,...
Read more >Web3 Provider - WalletConnect Docs
This is documentation for WalletConnect Docs v1.0, which is no longer ... import WalletConnectProvider from "@walletconnect/web3-provider";
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems
WalletConnectProvider.default
is the class itself. Why do I have to do this and why don’t you update examples?@lalitsharmaprofile-work
Will share when I have a chance but will note that I swapped back to V1 because V2 isn’t supported by most client wallets yet.