You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have narrowed it down, something about createInsertSchema from the drizzle-zod package, combined with zValidator("json", test) doesn't work well together.
This is a TypeScript type matter, not dependent on a runtime. It does not seem to be a bug. Could you ask this on Discussion or provide a minima project to reproduce it?
What version of Hono are you using?
^4.4.7
What runtime/platform is your app running on?
Bun / Vite
What steps can reproduce the bug?
The Setup:
/api
folder which has a basic Hono server with some routes (uses bun)/frontend
folder which has a react app (uses vite)The goal:
Use the
hono/client
in a react useQuery hook to fetch data.What's wrong:
Somewhere along the way, the
hc
object is not being properly typed.In the
/api
code, notice if I hover over the type ofExecutionsRoute
we can see all attributes ofoutput
:In the
/frontend
code, notice if I hover over the type ofclient
, we can see the attributes ofoutput
getting dropped:What's wild is that if I jump-to-definition of
ExecutionsRoute
from the/frontend
folder, it correctly brings me to/api
.What is the expected behavior?
The typing of the
client
which useshono/client
should preserve the types of the input and outputs.What do you see instead?
The output is getting cast to
When it should be
Additional information
Could it be the difference in build tools (bun vs. vite)?
I've tried restarting the TS lang server on VSCode multiple times.
The text was updated successfully, but these errors were encountered: