Hono

H

Hono

This is the official Hono discord server for the community

Join

Middleware errors are not being returned in response type

I have a user route using an auth middleware, ```ts export const usersRouter = new Hono() .use(authorize) .get('/', async (c) => {...

Hono SSE Stream Closing Unexpectedly After 10 Seconds

Title: Hono SSE Stream Closing After 10 Seconds Issue: Using Hono's streamSSE, the SSE connection closes after ~10 seconds, regardless of client (curl/browser). A minimal Node.js SSE server works fine. Environment: Debian, localhost...

Combine SSR and Client Components without HonoX

What's the prefered way to have these two working together with syntaxic coloration and no raw html in one color in my VS Code editor? SSR: https://hono.dev/docs/guides/jsx Client side: https://hono.dev/docs/guides/jsx-dom...
No description

How do I serve hono on https

Hello I'm using Hono with Bun, and I would like to serve the the application on https://localhost:3000, I couldn't find any documentation on this. Any help would be greatly appreciated 🙂...

Enforcing strict types for Hono's c.json() responses?

Is it possible to enforce strict typing for Hono's c.json() responses at a top level (hono.Handler<..>)? Currently, I can define expected response types like this: ```ts type MyResponse = {someType: string};...

Sharing the app type from my hono api to my client in a monorepo

I'm trying to share types between my Hono API and Svelte app. Currently doing this: ```js // Hono app - apps/api/src/index.ts...

Setup Hono with Datadog APM?

Has anyone been able to make this integration work? I'd love to understand more how to do it...

tRPC subscriptions throw net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) with httpSubscriptionLink

When using the Hono middleware as per the instructions, and setting up a tRPC subscription, the following error is thrown in console and a loop is created that eventually leads to a memory leak at the server:
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
...

Where Can I found WS api documentation ?

Hello I would like to know if it's possible to fill "origin" in the WS event. Or find a way to add identity information about the sender. Or get ip address of the sender. Where Can I find ws API documentation Hono documentation ?...

background jobs with Hono + Bun

Hi all, I'm planning on building a backend with Hono and I'm looking for a solution to do background jobs (backed by a queue). Are there any recommendations in the bun ecosystem for doing this? So far, I've mostly seen BullMQ in the node ecosystem, but bun is not officially supported as far as I know. Is there an alternative for bun?

Getting 504 Gateway-timeout error on hono serverless api

hey everyone, I’m encountering an issue in vercel serverless which gives me 504 error. I have deployed hono backend that have / API endpoints(GET,POST), on get method it works fine. but with post method it gives me below error: https://hono-serverless-gateway-timeout-error.vercel.app/...
No description

Handle websockets from Durable Objects

I have my own Durable Object class that implements websockets. It works well with raw cloudflare workers But when I try to implement hono, it does not works. How to make Hono handle my Cloudflare Durable Object with Websocket. I do not want to use the Hono websockets helpe, I have my own class to handle it. ...

how can I specify the return type of the response of API response

For example I want to do something like this
type a = (c:any) => JSON<{message: string}>
c.get('/', (): a => {})
type a = (c:any) => JSON<{message: string}>
c.get('/', (): a => {})
...

Help Understanding Cache Middleware

My understanding of caching is not great and I wonder if someone could help me with a few questions I have on caching. If there are any learning resources that you think could help me I would be ever so grateful. - How does Hono handle caching of requests for api endpoints or static assets on the server and on the client. - Are requests/responses cached on the server as a default?...

WebSocket client not working

get this code: 1006, reason: "Failed to connect"
No description

c.env.incoming already piped with an await?

It's an issue i've been trying to solve for a few months now, when running this example it wont print the "Hello" text to the console, however, when removing the commented line or removing the zValidator will print the "Hello" to the console. Is the c.env.incoming already being read somewhere else? ```ts import { HttpBindings, serve } from '@hono/node-server'; import { zValidator } from '@hono/zod-validator';...

Cannot load `hono` from JSR

Hello, we're using Deno and are getting the following error when importing hono using the jsr:@hono/hono import which has worked for us for the past months:
import 'https://registry-staging.deno.com/@hono/hono/meta.json' failed: error sending request for url (https://registry-staging.deno.com/@hono/hono/meta.json): error trying to connect: dns error: failed to lookup address information: nodename nor servname provided
import 'https://registry-staging.deno.com/@hono/hono/meta.json' failed: error sending request for url (https://registry-staging.deno.com/@hono/hono/meta.json): error trying to connect: dns error: failed to lookup address information: nodename nor servname provided
...

Is type augmentation for Variables in hono/env possible?

Good day everyone, I recently started using honox in a new project and I want to figure out if its possible to do type augmentation for the Variables type (inside Env). I'd like to have c.var.db to be of type Database from ../lib/database...
No description

sentry is not a function

hi i m using hono sentry middleware getting ``` [ERROR] TypeError: sentry is not a function ...