vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
9.43k stars 1.38k forks source link

Sveltekit handleSubmit sends back data as undefined #2796

Open ghoshsanjoy78 opened 3 weeks ago

ghoshsanjoy78 commented 3 weeks ago

Description

The issue 1270 is still happening.

On the client side, I am calling handleSubmit like so - handleSubmit(e, { data: { options: dataToSendBack } });

On the server side in /api/chat/+server.ts file when I check the data property on request, it comes through the first time but all subsequent calls, comes through as undefined

const { messages, data } = await request.json(); console.log(data) // Shows as undefined except the first time

Code example

No response

Additional context

No response

lgrammel commented 3 weeks ago

Which packages versions are you using? Which hook are you calling?