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.