Wallet Connect Import Bug

I have tried npm installing wallet connect and using the I get the same bug.

@walletconnect/web3-provider”: “^1.7.1” is in my package.json file so I am very confused.

What error do you get? I try to recreate the issue, but I do not get the error.

Do you have more info, to let me reproduce this error?

  • Do you have other errors as well?
  • What packages are you using (and what versions), mainly regarding moralis, react-moralis, and walletconnect
  • Do you use a framework? Like next.js, create-react-app etc. (and what version)?

I’m using truffle and no react at all. This is my package.json file:
{
“name”: “frontend”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”
},
“author”: “”,
“license”: “ISC”,
“devDependencies”: {
@metamask/detect-provider”: “^1.2.0”,
@openzeppelin/contracts”: “^4.4.0”,
@walletconnect/web3-provider”: “^1.7.1”,
“p5”: “^1.4.0”,
“walletconnect”: “^1.7.1”,
“web3”: “^1.6.1”
},
“type”: “commonjs”,
“dependencies”: {
@walletconnect/client”: “^1.7.1”,
@walletconnect/qrcode-modal”: “^1.7.1”,
“walletconnect”: “^1.7.1”,
@walletconnect/web3-provider”: “^1.7.1”,
“truffle”: “^5.1.33”
}
}
and I also have: at the top of my index.html file.

I’m not really sure where to go from here, all of my other imported/external scripts work

Where is the dependency of moralis?

Or do you import it via the index.html file? If that’s the case, then you need to import walletconnect/web3-provider also in the html file. Via a script tag as described in https://docs.moralis.io/moralis-server/users/crypto-login#walletconnect

Yes, I am using a script tag and it is at the top of my index.html file

Can you try if it works with moralis v1.0.4, we just released a fix

Yep it works with the older version thank you