I apologize in advance if this problem is caused by my own stupidity. But I have a problem with the mediasoup client and webpack minimize=true
.
Exactly that - minimize = true or minimize = false - in my webpack.config makes the difference between “crashes” and “runs”.
The command that worries about this and ends with this error message
undefined is not an object, evaluating e.kind
is this:
const producer = await this.producerTransport.produce(params)
after having obtained a media stream track from iOS or macOS. To make matters worse, it only occurs with Safari and with all browsers in iOS.
In the non-minimized version, this immediately ends up in the “produce” callback of my producerTransport. In the minimized version, there is the error and the function does not return.
I could hunt down the problem up to the “debug” line in the screenshot below. Executing this crashes. In fact, “e” is undefined at this point (validated by console.log)
I am now wondering if there is any way to further isolate the problem.
I need to mention, that I put the track “as-is” into the params structure for produce
const track = audio ? stream.getAudioTracks()[0] : stream.getVideoTracks()[0]
const params = {
track
}