Hono

H

Hono

This is the official Hono discord server for the community

Join

HtmlEscapedString not rendering?

When I have this function ``` import { HtmlEscapedString } from 'hono/utils/html' ...

validating arrays coming from forms

The following code works ``` <form action='?'...

return type of request handler

Why is 1) is fine and 2) has a type problem? 1) ```...

[solved] route param validation with zod

``` .delete('/foo/:id', zValidator('param', z.object({ id: z.number() })), async (c) => { const { id } = c.req.valid('param')...

Having middleware routes in RPC

Hi, I'm setting up honojs as the API of a SPA, with authjs as authentication library using the honojs middleware (https://github.com/honojs/middleware/tree/main/packages/auth-js) I have the auth and RPC setup in the following way ```JS app.use('/auth/*', authHandler());...

Importing AppType to client defaults output to any types

Hi, I just started using Hono yesterday and I'm loving it, but I'm facing an issue where, when I import AppType to the client, the types for output default to the Any type. I'm currently stumped on why this happens. Client src: /packages/frontend/src/lib/apis/images/index.ts ```typescript import type { AppType } from "@tavern/functions/src/stableDiffusion";...

How to use handlebars or pug in honojs?

Hi, i'm want to use view engine (like handlebars and pug ) in honojs. Is there any way to use it?

How to handle multiple errors in (react query) using (hono rpc)?

How can I handle multiple errors like in my case? I want to display the error on my signup form layout....

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
Next