'Mediasoup client on react native crashes when transport.on('connect' calls callback()

Am using mediasoup for video conferencing, but on the connection stages, where transport.produce() invokes transport.on('connect' event when i execute callback from transport.on('connect the application crashes

producerTransport.on(
  'connect',
  async function ({dtlsParameters}, callback, errback) {
    await Request('connectTransport', {
      dtlsParameters,
      transport_id: data.id,
    })
      .then(data => {
        callback();//crashes the application when called, 
      })
      .catch(errback);
  },
);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source