Hono

H

Hono

This is the official Hono discord server for the community

Join

conninfo doesn't check for x-forwarded-for?

I am on a host with a caddyserver reverse-proxy and want to make sure the client is coming from a whitelist set of IP addresses. So I set up the server using the ipRestriction middleware as per the docs. I am running it using bun. However the reverse proxy uses the x-forwarded-for header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For I was wondering should conninfo or the ipRestriction middleware check for it?

RPC InferRequestType with Param gives "Property is incompatible with index signature."

I've been learning Hono, been having a great time with it as it solves my biggest grief with NextJS API routes! I've run into some problems with type inference. I have two path params, and would like to be able to simply pass {param: {storeId, billboardId}} to the request call but Typescript complains with the message below [and in screenshot]. Am I using something the wrong way in Hono ? is there a better a way of solving this ? ...
No description

Hono Scalar failed with Vercel serverless function

I use @scalar/hono-api-reference to show an Api documentation and my stack use vercel with api directory. When I use vercel dev or in production mode, I have this error ```...

Adding Cron!

Hello I'm working on a new project using Hono and I'm actually having a ton of fun. The thing is I need to add Cron Jobs to this project and while with other frameworks it's pretty straight forward with official documentation in Hono there is no docs about it. Can anyone help with how it should be achieved?

Using HonoX with React and react-three-fiber

Hey all, I think I may be attempting something a little too tricky. I'm trying to make a HonoX project with a client-only island that uses react-three-fiber. A base install gives this error when hitting the page: ``` module is not defined at eval (/Users/alexturpin/src/project/node_modules/react-reconciler/constants.js:8:3)...

Hono CORS lambda duplicate headers

I'm using Hono with Lambda and managing CORS myself instead of using AWS API Gateway CORS configuration. My code looks like ```...

Trouble with using `hono/cookie` helper with honox

Case 1 - getCookie ```ts import { getCookie } from 'hono/cookie' const cookie = await getCookie(c, 'testCookie');...

Unable to get RPC working with the inferred input type

Server is a simple example from the docs, using Bun. The client is a simple component in Vue. Path-type and return type seems to work correctly, but the input type does not. I would assume type safety should complain if I send it something other than what I give to zValidator? Also, it does not help me auto-complete the query.name...
No description

Nested islands in HonoX

I'm trying to nest islands in fashion similar to this: ``` // islands/toggleSection.tsx export const ToggleSection = (children, isOpen, onToggle) => {...

how to use mongodb with cloudfare hono

Hey guys can anyone help me integrating my mongodb with hono cloudfare.

zValidator Middleware Error

I have literally only implemented the example ```import { zValidator } from "@hono/zod-validator"; import { Hono } from "hono"; import { z } from "zod";...

JSX.Element

Namespace ... JSX has no exported member 'Element'. I have a simple type like this ``` export type PageProps = {...

How to upload a file and track it's progress on the client-side?

I send a file with the following function: ``` const uploadFile = async (thatFile) => { // Use a custom TransformStream to track upload progress...

Cookies not available in other Route

``ts r.get("/login/:userId", async (c): Promise<Response> => { const redirectUri = ${c.env.WORKER_BASE_URL}/callback`; setCookie(c, "userId", c.req.param("userId"), {...

Uploading a file using FormData from React Native to Hono

using Hono 4.4.13 What runtime/platform is your app running on? NodeJs ...
No description

Sentry - hono/trpc/cloudflare workers

Hi guys, I'm trying to implement sentry into my hono/trpc/cloudflare application. If I'm just using the @hono/sentry middleware, what errors are exactly being caught? Will this middleware automatically catch all expcetions thrown from my middleware trpc server? I guess if I want to have a bit more fine grained control (as to when I'm capturing exceptions) inside of each of my trpc procedures, I need a bit of a different implementation, right? I'm not quite sure if I understood how everything works, I would very much appreciate any feedback!...

Custom response with bearerAuth

I would like to return a custom response when verifyToken is false. ``` const authMiddleware = bearerAuth({ verifyToken: async (token, c) => { const data = await c.env.AUTH.get(token);...

Enforce OpenAPI types

Hey there, I'm currently working on a openapi-router package, which aims to enforce types (generated from an OpenAPI document using openapi-typescript) in the routers of web frameworks like Hono or ExpressJs. I've successfully added support for ExpressJs, as its typings are relatively straightforward. However, I'm finding the Hono types more complex, and I could use some assistance in creating the appropriate Hono types for the openapi-router package. ...

zValidator not coercing types correctly

"@hono/zod-validator": "0.2.2",
"hono": "4.4.10",
"@hono/zod-validator": "0.2.2",
"hono": "4.4.10",
...
No description