MetaMask / snaps

Extend the functionality of MetaMask using Snaps
https://metamask.io/snaps/
Other
724 stars 557 forks source link

Problems with Websocket requests #1004

Closed paulfears closed 1 year ago

paulfears commented 1 year ago

Not really sure whats going on here Was trying to use xrpl.js but anytime it trys to make a websocket request I get this error, It used to work on older versions of the snaps interface, with an older version of the compiler Error: lockdown.umd.min.js:1 Error: Unhandled error. (undefined) at Client.emit (eval at (eval at (lockdown.umd.min.js:1:19217)), :29293:21) at Connection.eval (eval at (eval at (lockdown.umd.min.js:1:19217)), :43710:18) at Connection.emit (eval at (eval at (lockdown.umd.min.js:1:19217)), :29300:11) at Connection.onMessage (eval at (eval at (lockdown.umd.min.js:1:19217)), :43450:24) at WSWrapper.eval (eval at (eval at (lockdown.umd.min.js:1:19217)), :43486:55) at WSWrapper.emit (eval at (eval at (lockdown.umd.min.js:1:19217)), :29300:11) at WSWrapper.ws.onmessage (eval at (eval at (lockdown.umd.min.js:1:19217)), :43185:18) at WebSocket. (bundle.js:2:717975)

I hate to have so little info, but im kind of at a wall. -cheers

FrederikBolding commented 1 year ago

Hi @paulfears - Do you have the source code available for the snap you are having issues with? That would help us reproduce your issue!

paulfears commented 1 year ago

Here's the source code https://github.com/Kyraview/SnapXrpFork

It's purposely version 20 of snaps because the library requires Buffer, and there's a patches that have to be applied if you guys try to run it. I appreciate you guys taking time to look at this issue

FrederikBolding commented 1 year ago

Which version of Flask are you using? The version from the Chrome Store or building locally from the extension develop?

FrederikBolding commented 1 year ago

If you are using the Flask version from the Chrome Store, there is a known and fixed bug with WebSocket that will be fixed in the next release! Meanwhile if you are comfortable with it you can build the MetaMask extension locally as that has more recent changes.

paulfears commented 1 year ago

I'm using the chrome store release. very cool thanks