I am trying to debug why my transport.produce() is failing on the client side and while doing so ended up in the following line:
mediasoup-client/src/Transport.ts
Line 481 in 3e9a180
const { id } = await this.safeEmitAsPromise(
this.safeEmitAsPromise comes from the EnhancedEventEmitter and in this method it calls safeEmit() which in turn calls emit() which returns a boolean.
So the destructoring of the promise return value via { id }
should never be able to work.
That being said, I am not a Javascript developer so might very well be missing something but I see the browser throwing an error there.
The same problem might be in the related code for produceData().
I am not confident that my understanding of the code is 100% correct and somehow the demos are working after all. What confuses me I guess is the code in safeEmitAsPromise() which passes the resolve and reject callbacks as additional arguments to safeEmit() but that method never does anything with them apart from passing them again as args to emit() which as far as I can tell does not understand these callbacks.
I hope someone can shed a bit of light on this. Thanks!