Bun Monorepo Hono RPC
I'm trying to setup hono rpc, but I'm not able to get the types or autocompletion for it. I did check to make sure the compiler options are set to strict: true but doesn't seem to work.
If you don't mind checking https://github.com/nikevsoft/bun-monorepo what I'm doing wrong?
GitHub
GitHub - nikevsoft/bun-monorepo
Contribute to nikevsoft/bun-monorepo development by creating an account on GitHub.
11 Replies
try chaining like this
i gave that a try, it didn't work as well 😦
I'll clone it and try
it did work for me?
I cloned and installed then only changed this
this is the server index
hmm that's so odd mine just doesn't work. I even tried in github codespaces and also got the same issue.
you're not doing correct
you're doing this
but you should do this
oh man, thank you!! I didn't think that would make a difference. Do you know why you cant do it the other way?
Thank you @Shy !
Honestly my brain just became typescripty…? I can’t exactly understand why but even from the first day I saw it I knew it will probably not work 😅
But anyways looking at the typescript docs https://www.typescriptlang.org/docs/handbook/type-inference.html
type inference happens when initializing the variables
That’s why hono suggests always doing this practice https://hono.dev/docs/guides/rpc#using-rpc-with-larger-applications
Documentation - Type Inference
How code flow analysis works in TypeScript
RPC - Hono
Web framework built on Web Standards for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.