I’m trying to integrate Mediasoup into my project and started by simply porting this example GitHub - mkhahani/mediasoup-sample-app: Mediasoup v3 sample app (which works well when run as a standalone).
However as soon as I try to call transport.produce() on the frontend I face an error “Cannot read property ‘emit’ of undefined” thrown from mediasoup-client/lib/EnhancedEventEmitter.js
Everything before that point runs smoothly, all the data exchanged with the server corresponds more or less to the data in the example above.
I found a similar issue on GitHub (TypeError in Transport.ts, transport.produce() failing · Issue #127 · versatica/mediasoup-client · GitHub) but @ibc directed that person to the forums, and I couldn’t find that topic here. Has anyone here faced anything similar to my problem? I would be very thankful for any possible hints.
console.log(this) into EnhancedEventEmitter, function safeEmitAsPromise, makes it work. But how to avoid that error without modifying Mediasoup’s code?