Type 'Hono<App {...}>' does not satisfy the constraint 'Hono<any, any, any> Property '#private' in t
Hi, I'm trying to use hono RPC client on my frontend project. But the type not working properly. I'm using "hono": "^4.3.7", on server and client.
// On /web-api/src/routes/index.ts [Server]
// On /web-api/src/routes/users/index.ts [Server]
// On /web-api/tsconfig.json [Server]
// On /web-ui/tsconfig.json [Client]
2 Replies
// On /web-ui/src/lib/hc.ts
AppType showing type error
Type:
Hono<App, { "/users": { $get: { input: {}; output: {}; outputFormat: "json"; status: 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | ... 44 more ... | -1; }; }; "/users/test": { ...; }; }, "/">'
does not satisfy the constraint Hono. 'Hono<any, any, any>'
Property '#private' in type 'Hono' refers to a different member that cannot be accessed from within type 'Hono'.ts(2344)
Property '#private' in type 'Hono' refers to a different member that cannot be accessed from within type 'Hono'.ts(2344)
You have an error and your Hono entry point. The routes need to be set as the types not the app