Batch Patch Error
why is this throwing error
error:
[CONVEX M(products:updateFeaturedProducts)] [Request ID: 583339ec3107f9e8] Server Error
Uncaught Error: undefined is not a valid Convex value (present at path [0] in original object ["undefined"]). To learn about Convex's supported types, see https://docs.convex.dev/using/types.
at convexToJsonInternal (../../node_modules/convex/src/values/value.ts:287:6)
2 Replies
ctx.db.patch
doesn't return anything so your function is returning an array of undefined
values, which isn't supported. You can fix this by using await Promise.all
instead of return Promise.all
thanks, it worked