JustUseFirefox
Explore posts from serversRPC type error - Unable to interop
Someone over at edgedb suggested removing the context and calling the database directly inside a route, but the issue persist.
I think it's either how edge
e
returns type, or how hono infer types for RPC
6 replies
How to pass and validate cookies (server<>server) ? (RPC)
I understand, but in this case, hono client is called on the server (SSR side). I realised this is by design cookie-side. The client have the cookies, and the svelte server receive them. I then need to pass them from svelte server side to hono api in a nice way... But I just resorted to a json post and pass them there with some check.
6 replies
RPC type error - Unable to interop
Yup, Hono's side of things.
I've updated the repo with a simpler version that doesnt rely on @repo/edgedb and multiple imports but the error persist no matter what.
Everything points to Hono, as soon as
import { type AppRouter } from "@repo/api-hono"
is present in Svelte ui, the error appears.
But this is kind of required to make use of RPC 😂6 replies
How to use Validator ? Context is not finalized
Found the culprit !!!
The first middleware that is suppose to make my db connection inside context causes this.
Strange as I was succesful into inserting requests but I must have changed something somewhere. 😂
adding
await
before next()
solves the issue 🤦16 replies
How to use Validator ? Context is not finalized
I might have found the underlying issue...
I'm using
const body = await c.req.parseBody()
so I need an async function in the main handler. and then I try to return values:
https://hono.dev/docs/api/request#parsebody
This throws an error api-hono:dev: error: Context is not finalized. Did you forget to return a Response object or
await next()?
16 replies
How to use Validator ? Context is not finalized
don't do anxiety to reply lol, just leaving this here for when you're home and have time 😇
Post form test in the repo: https://github.com/honojs/hono/blob/73ff6c0e82d66468e28ed439481220f56ab03882/src/validator/validator.test.ts#L217
But it doesnt work on my end.
On my end, I tried adding next, but it doesnt like it.
package.json:
"hono": "^4.5.11"
16 replies
Is it safe to store user data with set/get?
Thanks for your reply, Nico ! Can you clarify " I never let the application query that data so it can never be leaked accidentally to any user" ? English isn't my native language, this sentence confuses me a bit 😂 I feel like I'm missing something in my interpretation 😛
9 replies