Hono

H

Hono

This is the official Hono discord server for the community

Join

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] ```js import { App } from "@/@types/app";...

Is it safe to store user data with set/get?

I read (https://github.com/honojs/hono/issues/585#issuecomment-1826189093) that context state can be shared if the request is handled by the same worker. Is it safe to store user/session data with set/get?

ContextVariableMap not recognized during build from other package in monorepo

I created src/hodo.d.ts file in my Hono project: ```ts import { User } from './schema'; declare module 'hono' {...

Is there a way to subscribe/publish with Hono webSocket middleware (for Bun)?

I am definitely far from familiarity with websockets but I am excited to try it out with Hono. I am just testing it out trying to build a basic chat application with rooms based on a URL but for some reason I can only get the websockets to publish to an individual session and not for multiple users on different browsers. I see there is a ‘raw’ object on the websocket object that has subscribe and publish but the publish doesn’t seem to broadcast the message. I am totally open to additional docs...

Combine JWT middleware with other middleware

I have a file made /middleware/jwt.ts: ```typescript import { Context, Next } from 'hono'; import { jwt } from 'hono/jwt'; ...

Proper error logging and tracing?

Do you guys have an example repo that properly sets up error logs and trace? It seems too difficult to trace here (in the image). As you can see it only traces back to the library-code that threw the error. ...

What data should be sent from the client to use clerk middleware?

I'm working on a react-native app using expo. The back-end is built using nodejs & hono. I'm using clerk middleware to handle auth. What data should be sent from the client to authenticate requests(tokens, ids...) ?

Websocket with Bun

I've tried everything but I can't get WebSockets to work with Bun, also the git issues were not helpful, does anyone have an idea ? ```js import { createBunWebSocket } from "hono/bun"; import wsApp from "./routes/websocket";...

Custom jwt middleware

I want to check whether the user exists in the database based on the ID that I took from the sub payload using JWT middleware. Anyone can help me for the example code?

Sentry middleware incomplete report

I want to use Hono + Sentry, the target environment is Cloudflare, but for now I'm running it locally. here's a simplified version of my code: ```typescript const app = new Hono<AppType>() app.use(sentry())...

how i connect my hono application with supabase project

how i connect my hono application with supabase project

Using hono.js rpc on my expo router project

Is there an example template for this kind of project? I'm trying to use hono rpc to my expo router project, my folder structure is like this: [project name] [client] = (React Native Expo Router)...
No description

How can I format response in Hono

I would like my responses to adhere to a particular format, what is the best way to achieve this?

Seeking Help with Prisma Accelerate and Hono Setup in Turborepo

Hello, I'm Christer, and I'm currently working on an open-source project using Hono with Prisma. I have everything running on my local server, but I've encountered an issue that I believe might require some tweaking on my end. I'm utilizing a turborepo for this setup, and I suspect that I might need to use Prisma Accelerate to get Hono working properly. Below is the error message I'm seeing:...
No description

What is the correct project structure for RPC?

I'm working with React Native, and I want to use Hono.js for the backend, is this project structure correct to use RPC? [project name folder] ├── react native folder ├── honojs folder...

how to stop request that being processing by hono server from client?

i'm thinking about AbortController from vanilla javascript, but it is only aborting the request in the client right? how can i abort the request in the server, which in this case is processed by hono. i only found this [1], but it is used for RPC, in my case hono is run on different server. i also found this issue [2] but i didn't see the abort method. hono v4.3.4 [1] https://hono.dev/guides/rpc#init-option...
No description

Difficulty using OpenAPI registry parameters with createRoute

My setup is index.ts -> has hono app, imports routes schema.ts -> has zod schemas defined routes.ts -> uses createRoute from defined schemas ...

OpenAI Streaming doesn't work

hi, I want to stream the openai response to my frontend. In my frontend, the text is suddenly displayed and is not streamed. In my backend code I see through the consolge log that it outputs the words individually. But in the browser dev tools it looks like the client gets the data all at once. I'm not sure why it doesn't work. Does anyone have a guess? ```ts //backend const res = await openai.chat.completions.create({ model: 'gpt-3.5-turbo',...

Error: Missing Clerk Secret key

I'm using clerk with hono middleware to handle auth: https://clerk.com/changelog/2023-11-08 The code is really simple: `import { clerkMiddleware, getAuth } from "@hono/clerk-auth"; import { serve } from "@hono/node-server";...

App breaks in RPC mode, works normally

Hi, as soon as I export the AppType as mentioned in the docs. I start getting this error. If I do not export the AppType and do the normal export default app;, app works fine here is my index.ts ``` import { Context, Hono } from 'hono' import { secureHeaders } from 'hono/secure-headers'...
No description