tejask
(Tejas Kumar)
December 20, 2024, 1:08am
1
I can’t quite understand this error and it only appears when invoking a serverless function (Astro) on Vercel. It seems to have something to do with the AI SDK, but it’s quite strange because my function fails in prod but works locally.
I’m on Node v20 both locally and on Vercel; AI SDK@^4.0.20.
2 Likes
tejask
(Tejas Kumar)
December 20, 2024, 9:03am
2
For added context—this is a serverless vercel function. The build passes, but this invokes with a 500 immediately.
2 Likes
tejask
(Tejas Kumar)
December 20, 2024, 9:48am
3
Fixed it.
The fix process:
npm why module-in-the-middle
look where it’s used
@otel and @sentry /otel
Turns out Sentry auto-instrumented generateObject
and made it crash. Wild that they didn’t show up in the stack trace at all but ai
did.
Removing Sentry fixed it.
3 Likes
pawlean
(Pauline P. Narvas)
December 21, 2024, 12:06pm
4
Hey, Tejas! Nice to see you here. Glad you got a solution - thanks for sharing. We also shared it with the team internally for info
1 Like
system
(system)
Closed
December 28, 2024, 12:07pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.