v
v7mo ago

Issue with Type Errors when Exporting Routes with ActionCtx result.

When I export the route, imported types from _generated default to any. Adding Promise<Response> to the lambda or using zValidator for the response resolves type errors. Regardless of abstracting logic or stringifying results, this type error persists. Unsure of the cause, it seems specific to returning values from the action context. My goal Hono Documentation on API Routing and RPC Client Guide. Any insights appreciated. This is not a big issue because i can use zValidator. I just want to understand.
RPC - Hono
Ultrafast web framework for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.
Routing - Hono
Ultrafast web framework for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.
No description
No description
9 Replies
v
vOP7mo ago
when i dont try to return the result
No description
lee
lee7mo ago
Actions | Convex Developer Hub
Actions can call third party services to do things such as processing a payment
v
vOP7mo ago
hmm, i can do this for c.env.runQuery and resolve that but the rest are still here.
No description
v
vOP7mo ago
ofc i can add Promise<Response> or use zValidator still but its kinda weird
lee
lee7mo ago
I think annotating the type or using zvalidator is the recommended solution to this type error That is weird i agree
v
vOP7mo ago
yeah i honeslty have no idea whats going on here xd but im going to use zValidator either way i didnt know if this is a bug or just typescript limitation just wanted to ask
lee
lee7mo ago
Yep for sure. This looks similar to what we've seen before, like https://github.com/get-convex/convex-js/issues/3
GitHub
Convex Actions - returning anything from "runQuery" or "runMutation...
When creating the app for the Web Dev Cody's hackathon, I found that returning anything from the ctx.runQuery or ctx.runMutation when using the Convex Actions ends with "circularly referen...
lee
lee7mo ago
But HonoWithConvex might have a slightly different issue; we can look into it
v
vOP7mo ago
thanks for taking your time to look at this. i appreciate it. it seems this type issue doesn't happen with elysia js