structuredClone ✨
Last week the Vercel AI SDK casually added a structuredClone call to the generateText functionality, causing it to now fail in the Convex runtime as it doesn't seem to be implemented. https://github.com/vercel/ai/commit/00114c5d0c606ea01ca614606e2b6499666e52d1#diff-479910b2e8ffb3ce9d79aca7bd77eb6972087a2137b71b1d098a2528e7fce454R499
Following the advice here https://discord.com/channels/1019350475847499849/1153313759440408627/1153355495483125810, I added the polyfill for structuredClone and it works! But, it would be cool to not have to do this, or
use node
. I imagine a lot of people will be hitting this in the coming weeks as our industry is now solely dedicated to building apps with AI™5 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Ooh yeah thanks for pointing this out! Agree that it would be great for this to work in the Convex runtime out of the box -- hopefully we'll be able to add this in soon + will update back here with any progress
the implementation has landed and i'm aiming to release it today. if you could share how you're using the vercel ai interface, i can test it to make sure it works 🙂 https://github.com/get-convex/convex-backend/commit/a8eadec43f5f28edce93c998ba46fb1216dbf05c
GitHub
implement structuredClone (#33796) · get-convex/convex-backend@a8ea...
implement structuredClone with credit to Deno.
this is our first op that doesn't use
convex_macro::v8_op
because it wants to do its own serde.
some of the options are simplified away beca...that turnaround tho :mind_blown_wow:
I'm pretty sure a simple generateText call with messages was triggering the issue:
However I can't test it now because it appears to be fixed. Thanks!