HonoH
Hono10mo ago
kota65535

I can't use tsconfig `paths` when using Hono RPC in monorepo

I have monorepo with 2 packages, client & server (Hono).
.
├── bun.lockb
├── package.json
└── packages
    ├── client
    │   ├── package.json
    │   ├── src
    │   └── tsconfig.json
    └── server
        ├── package.json
        ├── src
        └── tsconfig.json


I'm using Hono RPC for communication between client and server. It works perfectly, but when I define
paths
in tsconfig of server and rewrite import paths to use them, the Hono client does not infer the type correctly.

This is my minimum reproducer: https://github.com/kota65535/hono-test
And I've attached the screenshot when the type error occurs.
This is likely due to my own misconfiguration, but any help or advice would be appreciated.
423095562-5b42ab10-02f9-415c-962b-fbd70d0a6a56.png
GitHub
Contribute to kota65535/hono-test development by creating an account on GitHub.
Was this page helpful?