Hono

H

Hono

This is the official Hono discord server for the community

Join

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 ...

Websockets with honox

Good day everyone, I recently created a new project to try out something with webrtc and I decided to use websockets as my signalling mechanism. I am using honox as my 'meta-framework' and would like to know how to inject the websocket 'helper' into my server (as I do not have access to the server in the project, only the app). Any and all help would be appreciated, TIA.

Scalar, hono and hono/zod-openapi

Scalar documentation was working great in my projectuntil a while ago, now I suddenly get `` { "message": "Unknown zod object type, please specify type and other OpenAPI props using ZodSchema.openapi`.", "data": {...

Vitest with Hono

Has anyone been able to exand the basic app that comes with npm create hono@latest my-app -> "cloudflare workers" to work with vitest? I tried to reference the blog example that uses vitest but running into multiple issues. It would be great is the template came with vitest to work with hono/workers as I asuume this would be the default choice for antone starting anew project on hono. Here is my repo with this attempt: https://github.com/lane711/sonicjs/tree/feature/rebuild-vite

throw new ERR_MODULE_NOT_FOUND [Nodejs Template]

Following this guide https://hono.dev/docs/getting-started/nodejs#dockerfile i'm trying to create two scripts: one for build ("tsc") and anthoer for start the build ("node dist/index.js) buit i got this error ```2024-08-19 11:47:09 node:internal/modules/esm/resolve:265...

How to separate code into files for each handler without loosing the hono RPC typesafety?

I have an auth route , which i separated into its own file. But each route with method and handler are chained in one file and it already has 400+ lines of code. When trying to separate it into files and chain them all in index.ts with route(), RPC start to loose typesafety. Can someone share some patterns on how to do something like this ?