Client Response
I have a problem where what my API returns is not what the TS types say it is:
For example what I actually receive when logging
res
is simply an object that looks like this {email, message}. But there is no ok, json() that my IDE says there should be.
This is the route:

6 Replies
Seems to be working fine on my end

I am using ofetch as my fetch fn. could this be related?
ok when I change it to this it works: (use normal fetch)

neat
So is this issue resolved for you?
maybe because ofetch will auto parse reponse to json,so res.json() not found ,ts don't now about this ....
ref:
https://github.com/honojs/hono/issues/3699
https://github.com/honojs/hono/issues/2542#issuecomment-2151608887
use ofetch and without res.json()
https://github.com/RSSNext/Folo/blob/dev/patches/hono.patch
GitHub
How to use
hono/client
with a different fetch client · Issue #36...What is the feature you are proposing? I am trying to use hc with unjs/ofetch. Ofetch makes it quite easy to implement a jwt refresh flow, retries, interceptor, etc.. Technically, it does work fine...
GitHub
Folo/patches/hono.patch at dev · RSSNext/Folo
🧡 Follow everything in one place. Contribute to RSSNext/Folo development by creating an account on GitHub.
GitHub
A way to pass RequestInit on hc instance · Issue #2542 · honojs/hono
What is the feature you are proposing? Hi, I'm using NextJS and I would like to be able to pass the RequestInit param of the fetch instance on individual calls. Why ? Because NextJS overrides f...