Hi, Iām a new with Moralis and still learning as I make progress. Iām trying to create user signin by using wallets. Strange part is if I use MetaMask it works 100% perfect but when I use { provider: āwalletconnectā } it says: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ādefaultā).
Hereās my code:
<script>
//moralis server connection
const serverUrl = "******************";
const appId = "******************";
Moralis.start({ serverUrl, appId });
async function meta(){
user = await Moralis.Web3.authenticate();
window.location.href = "accounts.html";
}
async function connect(){
user = await Moralis.Web3.authenticate({provider: 'walletconnect'});
// window.location.href = "accounts.html";
}
async function checkMeta(){
const ethereum = window.ethereum;
if(!ethereum || !ethereum.on){
alert('This Application requires MetaMask Wallet, Please install MetaMask Wallet extension');
}
}
</script>
And to connect with Moralis Iām using:
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
Iām using VS code and I do have walletconnect, web3-provider installed, hereās my .json:
ādependenciesā: {
"@walletconnect/web3-provider": "^1.7.0",
"@web3-react/injected-connector": "^6.0.7",
"walletconnect": "^1.7.0",
"web3connect": "^1.0.0-beta.33",
"web3modal": "^1.9.4"
},
Iāve been stuck on this for last two days, I decided to leave it because MetaMask works so just continue with that but decided to work on it as itās not professional. Any help would be of great appreciation. Thank you.Preformatted text