Vercel Edge functions dying without hitting timeout limits

We am using the AI SDK to build a chatbot-eqsue application and doing the normal thing of storing the streamed assistant messages to a database onFinish of the stream. However, as soon as there is an asynchronous call there, the function just dies. This works within a local dev environment, not just nexjs dev, also via the vercel CLI.

I am out of ideas about how to fix this, checked the logs if the function was hitting any limits and it is not.
Can someone help me figure out what the issue could be.

Hi @programmeratvoltek, welcome to the Vercel Community!

Can you share the code and a the logs from the Vercel deployment so we can look further into this?

Please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.