Wallet Connect Authentication Issue

When I tried to connect/authenticate via wallet connect, below was the error thrown:

VM33746:1 POST https://speedy-nodes-nyc.moralis.io/WalletConnect/bsc/mainnet net::ERR_FAILED

(anonymous) @ VM33746:1
(anonymous) @ web3-provider.min.js:39
send @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:22
(anonymous) @ web3-provider.min.js:37
f @ web3-provider.min.js:37
handleReadRequests @ web3-provider.min.js:22
(anonymous) @ web3-provider.min.js:22
(anonymous) @ web3-provider.min.js:37
f @ web3-provider.min.js:37
handleOtherRequests @ web3-provider.min.js:22
(anonymous) @ web3-provider.min.js:22
s @ web3-provider.min.js:37
Promise.then (async)
u @ web3-provider.min.js:37
(anonymous) @ web3-provider.min.js:37
f @ web3-provider.min.js:37
handleRequest @ web3-provider.min.js:22
(anonymous) @ web3-provider.min.js:22
(anonymous) @ web3-provider.min.js:37
f @ web3-provider.min.js:37
handleRequest @ web3-provider.min.js:22
e @ web3-provider.min.js:39
d.handleRequest @ web3-provider.min.js:44
e @ web3-provider.min.js:39
u.handleRequest @ web3-provider.min.js:44
e @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:14
(anonymous) @ web3-provider.min.js:44
handleRequest @ web3-provider.min.js:14
e @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:14
(anonymous) @ web3-provider.min.js:44
handleRequest @ web3-provider.min.js:14
e @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:14
(anonymous) @ web3-provider.min.js:44
(anonymous) @ web3-provider.min.js:44
(anonymous) @ web3-provider.min.js:44
handleRequest @ web3-provider.min.js:14
e @ web3-provider.min.js:39
o.handleRequest @ web3-provider.min.js:44
e @ web3-provider.min.js:39
l._handleAsync @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:44
(anonymous) @ web3-provider.min.js:14
(anonymous) @ web3-provider.min.js:14
(anonymous) @ web3-provider.min.js:14
_fetchLatestBlock @ web3-provider.min.js:44
_updateLatestBlock @ web3-provider.min.js:44
_performSync @ web3-provider.min.js:44
await in _performSync (async)
_start @ web3-provider.min.js:44
_maybeStart @ web3-provider.min.js:44
_onNewListener @ web3-provider.min.js:44
u @ web3-provider.min.js:44
a.emit @ web3-provider.min.js:44
h @ web3-provider.min.js:8
a.addListener @ web3-provider.min.js:8
l.start @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:22
s @ web3-provider.min.js:37
Promise.then (async)
u @ web3-provider.min.js:37
(anonymous) @ web3-provider.min.js:37
f @ web3-provider.min.js:37
enable @ web3-provider.min.js:22
(anonymous) @ moralis.js:28874
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:28899
(anonymous) @ moralis.js:1510
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:1546
(anonymous) @ moralis.js:6072
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:6132
(anonymous) @ moralis.js:6330
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
Promise.then (async)
asyncGeneratorStep @ moralis.js:30910
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:6415
login2 @ VM33801 BakerySwap.html:1711
Show 60 more frames
2web3-provider.min.js:44 Uncaught Error: PollingBlockTracker - encountered an error while attempting to update latest block:
undefined
at t.exports._performSync (web3-provider.min.js:44:65333)
_performSync @ web3-provider.min.js:44
setTimeout (async)
u @ web3-provider.min.js:44
a.emit @ web3-provider.min.js:44
_performSync @ web3-provider.min.js:44
await in _performSync (async)
_start @ web3-provider.min.js:44
_maybeStart @ web3-provider.min.js:44
_onNewListener @ web3-provider.min.js:44
u @ web3-provider.min.js:44
a.emit @ web3-provider.min.js:44
h @ web3-provider.min.js:8
a.addListener @ web3-provider.min.js:8
l.start @ web3-provider.min.js:39
(anonymous) @ web3-provider.min.js:22
s @ web3-provider.min.js:37
Promise.then (async)
u @ web3-provider.min.js:37
(anonymous) @ web3-provider.min.js:37
f @ web3-provider.min.js:37
enable @ web3-provider.min.js:22
(anonymous) @ moralis.js:28874
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:28899
(anonymous) @ moralis.js:1510
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:1546
(anonymous) @ moralis.js:6072
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:6132
(anonymous) @ moralis.js:6330
tryCatch @ moralis.js:74719
invoke @ moralis.js:74950
(anonymous) @ moralis.js:74775
asyncGeneratorStep @ moralis.js:30900
_next @ moralis.js:30922
Promise.then (async)
asyncGeneratorStep @ moralis.js:30910
_next @ moralis.js:30922
(anonymous) @ moralis.js:30929
Wrapper @ moralis.js:57896
(anonymous) @ moralis.js:30918
(anonymous) @ moralis.js:6415
login2 @ VM33801 BakerySwap.html:1711
Show 24 more frames

BakerySwap.html:1 Access to XMLHttpRequest at โ€˜https://speedy-nodes-nyc.moralis.io/WalletConnect/bsc/mainnetโ€™ from origin โ€˜http://127.0.0.1:5500โ€™ has been blocked by CORS policy: Response to preflight request doesnโ€™t pass access control check: No โ€˜Access-Control-Allow-Originโ€™ header is present on the requested resource.

I think this relating to CORS policy issue.

Please help.

Is anyone experiencing same thing with me?

1 Like

yeah this is a stinky CORS error. and the problem with CORS is theres so many ways to solve it depedning on your situation. ive came across this a few times but the times i did its due to a mismatch between my deployed database and client urls. so not sure if the same solution will work for you. for me i got around the issue by add ing a proxy to my package.json. so if we look at the origin above it says http://127.0.0:5500 so in your package.json ad a proxy with this url

"proxy": "http://127.0.0.1:5500",

addd it directly at the top of your package.json below your version so like

{
  "name": "app name",
  "version": "0.1.0",
  "private": true,
  "proxy": "http://127.0.0.1:5500",
  ......
  .....
  ....

however as i said above this worked for me when i created and had control over my own database, since your using moralis im not sure if the same will apply but its worth a try. let me now how you get on

1 Like

when you do this stop your server and restart before trying to see if it works. again it might not just rying to throw something at you that could work as it for my situation

1 Like

Thanks for that. In my own case, the setup environment is html template not react and no use npm was used. This might be difficult for me to use package.json

1 Like

sorry misreading your question you meant your using html and and vanilla,js setup or your writing a script? unless your witing a script you dont connect with wallets on a client you set up your web3 provider through some provider like an infura node etc. so if you just want to write script then you would just do this and not need wallet connect. or if you do want tosme sort of interactive frontedn since your are using html (sorry just not 100% from your comment if you after a script or vanilla.js setup) if you are on about vanialla.js a lot of things are done through cdn links but for extra wallet support with moralis im not sure how this works with moralis. haven used vanilla.js in forever so i actually dont know what the solution for your situation is. however take that with a grain of salt i could be wrong about that because i have no prior experience myself with a setup akin to yours. @cryptokid am i correct in this assumption, id say you might know more?

you can look in the browser network tab to see the exact error message.

you can get this type of error if you try to use wallet connect more than a number of times in an hour, there was a rate limit added per IP and it should be per hour to allow only a number of requests to that particular endpoint

you can get CORS errors also where the url is blocked somehow or it gives timeout

1 Like

Yea it was a vanilla setup.

1 Like

ahh ok i see, sorry thats what i was unsure about. yeah follow cryptokids advice above

Initially, this is working perfectly with the vanilla setup until today it start giving CORS issue. My thinking was there was an update done in the library or so that make it throw the error.

Ok thanks mcgrane5