HonoH
Hono15mo ago
Franquito

RPC AppType breaks if route is defined on a separate file

Hello everyone,
Im trying to build a Hono backend with a Vite SPA as the frontend
Currently the file structure looks like the image attached
I (think) Im able to export the correct type from src/app (image)
If I try to create the RPC client on the backend (for testing), it works as expected (image)
But when I try to import the AppType on the client SPA, it gets imported as Any, thus not working correctly (image)
Ive looked through the discord posts and the GitHub issues, but I could not find someone with this error.
Both tscong.json have strict set to true, as the docs says
Im no TS expert so I cant debug what is happening
I restarted the TS server multiple times, reinstalled Node modules, etc. Nothing worked
Thanks in advance!
image.png
image.png
image.png
image.png
Was this page helpful?