Hono

H

Hono

This is the official Hono discord server for the community

Join

HTTP Status bug

Getting a weird bug when returning a response in my project for a post request. Previous get requests return data correctly, but this one is giving me problems for some obscure reason. This results in an Internal server error Error message: The status provided (0) must be 101 or in the range of [200, 599]...

How to serve hono streamSSE via nginx reverse proxy

2025/07/07 12:40:30 [error] 22#22: *1 upstream sent duplicate header line: "Transfer-Encoding: chunked", previous value: "Transfer-Encoding: chunked" while reading response header from upstream, client: 192.168.65.1, server: localhost, request: "GET /api/v1/robots HTTP/1.1", upstream: "http://192.168.1.120:5002/api/v1/robots", host: "192.168.1.120"

Serving a SPA with Hono breaks on Chrome but not Firefox.

Hi, I'm serving a vite-react app as described in the docs: ``` app.use("", serveStatic({ root: "./dist" })); app.get("", serveStatic({ path: "./dist/index.html" }));...
No description

Use hono with Turborepo's JIT packages?

I'm trying to setup a monorepo with Turborepo. One of the concepts are just-in-time packages. These packages export TypeScript files and are transpiled by the consuming application. My understanding is that these types of packages require a bundler. However, the hono server typically just relies on tsc. https://turborepo.com/docs/core-concepts/internal-packages#compilation-strategies Is there still a way I can use just-in-time packages with hono?...

Lazy routers?

Hi, does hono support lazy routers? I made a really huge router with some heavy dependencies and now I'm getting spikes on cold starts

Issue with c.req.formData() on Vercel

Hi I have a Hono API deployed on Vercel. I have a function that starts like this ```ts // Pusher auth route const pusherAuth = factory.createHandlers(authMiddleware, async (c) => { // Get socket_id and channel_name from the request...
No description

ERR_UNKNOWN_FILE_EXTENSION when running `bun create hono my-app`

``` $ bun create hono api
node:internal/errors:497 ErrorCaptureStackTrace(err); ^...

hono c.set() showing error but what is wrong and also prisma error

i dont understand what i am doing wrong like i understand the error but don't know how to resolve
No description

Cannot use `c.get` in `hono-rate-limiter`

I am trying to use the hono-rate-limiter package to create a middleware that enforces rate limits based on which consumer is accessing the API. Here's my implementation: ```ts const consumerRateLimitMiddleware = rateLimiter({...

Auth0 and Hono

I am building an SPA in angular to run on cloudflare with Hono as the back end. I'm trying to add some third party user authentication so I don't have to do it myself, and as this is a small project, Auth0 seems fine. The front-end part of angular+auth0 is working, however, I cannot get the back-end to work. I've tried both the auth-js middleware with an Auth0 provider, as well as just using the OIDC middleware and the jwt middleware. The auth-js just rejects the token (I have verified that the token was being sent), while the OIDC gives me a CORS error. I have no idea which of these is even close to working. I am also okay just switching to something else as long as its simple to implement in angular (better-auth has no angular support nor could I find any easy examples). I'm not terribly knowledgeable about this sort of thing, so I apologize if I get terminology wrong. Is there a good example of how to implement either the OIDC middleware or the auth-js middleware? Auth0 has an express example doing something with JWT, but I think its the same as the JWT in hono....

Does anyone have any recommendations for handling RPC response errors?

I want to do something like the parseResult function below so I can have consistent error handling across my app, but I've been struggling with getting type generics to work on the parseResult function such that the result type is correct. I'm kind of curious if anyone has recommendations on how to best handle using the rpc client throughout the app, or maybe I'm just over complicating things. ```ts...

Route is cached. Can't clear it even after ending server.

I had a hono app running a route as such: ```ts export const app = new Hono(); app.use(cors()); export default app;...

Changing the response in the middleware breaks it

As seen on the #Extending the Context type , I'm trying to do an arriValidator now to create a new middleware for the @arrirpc/schema validator (like the zValidator, which should actually just be standard validator, but whatever) But, when I add the created arriValidator to the handler, the handler just doesn't return anything, even when the middleware clearly said for it to ```ts export function arriValidator<T extends AObjectSchema>(schema: T): MiddlewareHandler { const problemSchema = problemResponse(schema);...
No description

Extending the Context type

So, I've made a function to work to with @arrirpc/schema (yes, it's a validator), so I can use it like this ```js export const routes = new Hono() .get("/", async (c) => { return respondWith(c, HealthSchema, { status: 200,...

Question about CSRF

Hey everyone Trying to use CSRF protection, and I'm wondering if that work like Laravel CSRF protection (input hidden with a CSRF token) ...

Looking for tips about best practices

hey everyone, question trying to use factories with my routes factory.handlers should contain one method ?...

honox asset caching

I'm using honox in my project. In production it creates a signed css and js files + adds all static files located in the public folder as expected. The issue is their cache control is set to public, max-age=0, must-revalidate Is there anyway to control it? I want to cache the css, js and static files forever

Streaming in Honox

Hi Guys, I am trying to use streaming in a honox.js app. ``` // routes/_renderer.tsx...

I want to create a middleware for hono that requires the previous middleware to have some property.

So currently I'm doing a project that have some path like this: /organization/orgSlug/functions... So I want all the methods in functions to have a valid org when I'm accessing them. This means that I need to do 2 things: - Validate that the orgSlug exists in the params - Validate that the orgSlug is pointing to an actual org. ...

basePath as route path

How to use basePath as route path? ```ts const route = new Hono().basePath("/api/file"); const server = new Hono(); server.route((route as any)._basePath, route); // tried this but doesn't work...