Ethers.js: Listening for any event ("*") with WebSocketProvider generates mysterious error

Created on 16 Apr 2020  路  3Comments  路  Source: ethers-io/ethers.js

Hi @ricmoo ,

When listening for any event ("*") using the WebSocketProvider, the server seems to hang on startup (not when an event comes in). Any idea why this may be the case?

I'm now on 5.0.0-beta.181.

var wsProvider = new ethers.providers.WebSocketProvider("wss://rinkeby.infura.io/ws/v3/my_id_here");
let contract = new ethers.Contract(rinkebyAddress, CONTRACT_ABI, wsProvider);

contract.on("*", (from, to, value, event) => {
  console.log("from: ", from);
});

console.log("hi"); // This is never called when server is started

bug fixed

Most helpful comment

Heya! Try out 5.0.0-beta.182 and let me know if that works better.

Thanks for finding all these bugs... Keep 'em, coming. ;)

All 3 comments

I've reproduced it. Working on it now... :)

Heya! Try out 5.0.0-beta.182 and let me know if that works better.

Thanks for finding all these bugs... Keep 'em, coming. ;)

Thanks @ricmoo ! The wildcard is working now. Appreciate your fast fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dagogodboss picture dagogodboss  路  3Comments

ricmoo picture ricmoo  路  3Comments

PhABC picture PhABC  路  3Comments

jochenonline picture jochenonline  路  3Comments

crazyrabbitLTC picture crazyrabbitLTC  路  3Comments