Hono

H

Hono

This is the official Hono discord server for the community

Join

Generic Types Not Working as Expected

I'm facing an issue with generic types in a PaginatedResponse setup. Here's my use case: Code Example: ```typescript...

Lambda Edge

I'm trying to follow thse instructions but I don't think it's working, no cloudfront distribution... https://hono.dev/docs/getting-started/lambda-edge...

Issue with ConnInfo

I'm trying to use const info = getConnInfo(c) To get the ip adress of the user for ratelimiting, but when I do console.log(info) I get this wrong ip: { remote: { address: '::ffff:172.18.0.1', port: 56124, addressType: 'IPv6' } }...

Default headers not setting in nextjs rpc requests

When using the rpc client in nextjs, it doesn't include the headers for the request like a normal fetch does, this ends up leaving out items like cookies which is needed for authentication on the server. ```ts import type { AppType } from "@buzztrip/api/src"; import { env } from "env";...

Argument of type 'Element' is not assignable to parameter of type 'Container'

Using https://github.com/honojs/examples/tree/main/hono-vite-jsx, stripped back for a minimal repro... The following code gives me a TypeScript error, "Argument of type 'Element' is not assignable to parameter of type 'Container'". Any ideas as to how best to resolve the error?...

Cookie not being set/created?

Hi, I am following a youtube tutorial https://www.youtube.com/watch?v=Av9C7xlV0fA and when I login there is no cookie value being generated.I checked my code multiple times and I see no difference. here is the code in raw format https://raw.githubusercontent.com/AslanHalil/jira-clone/refs/heads/main/jira-clone/src/features/auth/server/route.ts thanks....

Hono's Client does not work in Nuxt SSR

I have attached the the image using the native $fetch API of Nuxt to make a call to /api/profile and this works perfectly. However, I want the type-safety of RPC and so instead, I use the client. In the second image, there is now an issue. When the frontend is rendering the HTML in the server, the request is blocked and I have no idea why. There are two log statements and this is the output in the terminal, i.e. the server. In the server, the client does not make the request when it should. But it works perfectly fine in the browser. Can someone please help me??...
No description

Context is not available, context storage middleware

``` const app = new Hono<Binds>() app.use(contextStorage()); ...

Using TailwindCSS with Hono/JSX

Hello, When using only Hono, I serve html (hono-jsx) on a single endpoint, but I would like to style this with TailwindCSS. Is there a straight-forward way to accomplish this? My app is hosted via Convex (if that makes a difference)....

Abstracted routes but with context and types

I know there's some discussion of abstracted routes under https://hono.dev/docs/guides/best-practices. But there's no example which preserves the types from the context or middleware. ```ts import hello from "./hello.ts" ...

How to respond with multipart/form-data, containing image and json?

Hi, i'm trying to respond with multipart/form-data format but cant find any working example of how i should do this. https://hono.dev/docs/api/context#body How can i make working response with, for example, one png file const imageBuffer = await imageFile.arrayBuffer(); and some other field i.e. "{"json":"somejson"}"? I've tried some approaches but they didn't work and insomnia returned errors in attempts to read response. ...

Service Worker with react-router / tanstack router

Hi all, playing around with the service worker implementation and was wondering if anyone was able to get it to work with a client side router. I am running into an issue where the client side routing is taking priority over the hono service worker router.

Can I automatically serve endpoints from a folder?

Hey, I use Hono and Bun and wondering if I can automatically create routing for my endpoint instead of listing them one by one?
No description

Cookie not set 'hono/vercel', zod-openapi...

Hi, i have no idea why this route don't wok as i want it doesn't set Cookie ```javascript const GoogleRouteHandler: AppRouteHandler<typeof GoogleRoute> = async (c) => { const controller = new AuthenticationController(); const { state, code, url } = await controller.createGoogleAuthorizationURL();...

I want to return component to API response which contsin useState.

I have tried to return component but useState won't work, only messages like Hello World works
No description

How to fully set up oauth provider in hono?

I have a Next.js project here for my frontend, and my backend uses Hono, Drizzle ORM, and Neon database. I've already finished setting up my session database authentication. Now, I want to set up Google login using the third-party middleware provided in the Hono documentation for the OAuth provider. Here's my setup: after logging in with Google, I want it to create a user in my Neon database so that I can also handle the user's session in the database. The problem I'm facing is that OAuth has its own session, which is the 'state'—it seems like an access token that lasts for 1 hour. I'm not sure how to apply it to my session database management. Here's my flow for login and create a session of the authentication: ```ts...
No description

Hono Graceful Shutdown: Bun

Hono example with bun doesn't allow the use of Bun.serve, which would expose a method to stop or close. HonoJS app instance doesn't expose any method to close or stop all incoming connections to wait the resolve of all request before shutting down. In production apps graceful shutdown would allow for server to restart gracefully....

Any way to use @hono/auth-js without frontend?

Is there any way to use @hono/auth-js to create credentials provider session auth system without a frontend?

how to pass a body in the $put requestes ??

i want to pass a json body to a put request but idk how
No description