I started with the create-next-app template and have LLM chat inputs and outputs working fine on local and prod/Vercel.
App inserts record into supabase with chat input and output. Works fine in local.
On Vercel, nothing breaks, and no error messages. However, Supabase does not get the record.
Triple checked the API keys on Vercel dashboard. Also tried removing and then adding back the Supabase integration.
Operation occurs within the POST function, specifically inside the ReadableStream’s start method
const { data, error } = await supabase
.from(‘messages’)
.insert([{
content: message, // User input
ai_response: fullResponse, // LLM output
model: model // Model used
}]);
It’s inserting a new row into the ‘messages’ table with three fields: content: This is the user’s input message. ai_response: This is the full response generated by the LLM (OpenAI API). model: This is the model name used for this interaction.
-current versions of all packages