Hono

H

Hono

This is the official Hono discord server for the community

Join

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

Get the user IP address

Is there no better way to get the user IP address than doing this 👇🏽? https://github.com/EdamAme-x/deno-deploy-hono-ip/blob/main/entry.ts It works, but it's a bit convoluted. FYI, I use the IP address to implement a rate limiter....

Hono JS best practice for DRY

What are the best practices in Hono for writing APIs, specifically when one API (API B) partially replicates the functionality of another API (API A)? For example, if API A performs a specific task, and API B performs a different task but includes a part that is identical to the task in API A, what is the recommended approach to handle this overlap efficiently and maintainably?

hono/jsx/dom not re-rendering on state change

hiii, can someone tell me if i'm doing something wrong with client side rendering/hydration using hono/jsx/dom? it seems to mount and render properly but then state changes don't cause it to update. onClick={() => alert('...')} works as expected but onClick={() => setState(...)} does nothing, nothing in the console and no action. useEffect also does nothing. i think i followed the Client Components page pretty closely this is the component in question, it's rendered on both the client and server ```ts import { useState } from "hono/jsx";...