# \`transport.produce({...})\` not returning producer object

**URL:** <https://mediasoup.discourse.group/t/transport-produce-not-returning-producer-object/5232>\
**Category:** mediasoup libraries\
**Created:** [May 18, 2023, 9:14am UTC](https://mediasoup.discourse.group/t/transport-produce-not-returning-producer-object/5232 "2023-05-18T09:14:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhavmuchandi](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/vaibhavmuchandi/32/954_2.png) [@vaibhavmuchandi](https://mediasoup.discourse.group/u/vaibhavmuchandi)\
**Post date:** [May 18, 2023, 9:14am UTC](https://mediasoup.discourse.group/t/transport-produce-not-returning-producer-object/5232/1 "2023-05-18T09:14:32Z")

</div>

👋 Hey all,

I’m facing an issue with the ‘transport.produce()’ function in my code, and I’d appreciate your expertise in troubleshooting. Here’s the situation: when I call

```auto
const producer = await this.transport.produce({...});
return producer

```

The function doesn’t return the producer object. Strangely, the ‘produce’ event, set up with `transport.on("produce", async({...}) => {...})`, seems to fire correctly.

I’m scratching my head trying to figure out what could be causing this discrepancy. Has anyone encountered a similar problem before? Any insights on possible factors that could cause the ‘produce()’ function to not return the producer object while still triggering the ‘produce’ event successfully?

Im running `mediasoup^3.11.24` and `mediasoup-client^3.6.84` in a `Node v18.16.0` environment

Your input and suggestions would be immensely helpful! Thank you in advance for your support and expertise. 🙏

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [May 18, 2023, 9:24am UTC](https://mediasoup.discourse.group/t/transport-produce-not-returning-producer-object/5232/2 "2023-05-18T09:24:35Z")

</div>

You are not calling the callback given in the “produce” event or you are calling it with wrong data. Check the documentation of the “produce” event.
