Hono

H

Hono

This is the official Hono discord server for the community

Join

Hono and cloudflare bindings

I am using hono, orpc, drizzle and supbase. I want to create a db binding because the current set up is causing internal server error with cloudflare workers, database connection is getting created on every request, but i cant seem to find any doc or post about setting it up

hono + vercel + monorepo + turborepo -- what is the trick?

is there a trick to getting vercel.json to be used with turborepo? I have pnpm managing my monorepo but it seems like my apps/heimdall/vercel.json keeps getting ignored ``` { "$schema": "https://openapi.vercel.sh/vercel.json",...

Unable to render jsx with bun

Trying to utilize hono html and css for html rendering, but seem to get error: Cannot find module 'react/jsx-dev-runtime'. Sample code: ```ts import {Hono} from 'hono'...

Can I use JavaScript?

I changed the package.json file, and the program runs normally. I'm not sure if I need to change anything else.
No description

Serve Static file fail

Hi, kindly ask about serve static file issue. ```typescript ../prj/attendance_script/server/app.ts...
No description

OpenAPI route with 204 + content: {} cause type error with c.body(null, 204)

This is probably a bug i tried many ways to solve it but i will either get a typecheck error on the handler or lose inference for that route altogether library versions:
@hono/zod-openapi 0.18.4 @hono/zod-validator 0.4.3...

Hono: getCookie() Returns Undefined — Need Help!

Hey everyone! I'm working on a backend using the Hono framework and I'm trying to implement cookie-based authentication. I'm setting a JWT token in the cookie after login using setCookie, and I can see that the cookie is being set properly in the browser. But when I try to access it in my middleware using getCookie, it always returns undefined. I already set credentials: "include" on the frontend and allowed credentials in the CORS config, but still not working....
No description

OpenAPI not validating content type?

Let's say I have a post endpoint that takes json like this ```json { "name": "test" "age: 30...

double encoding oauth redirect uri

I'm using @hono/oauth-providers and my redirect URIs get double-encoded in Docker but not locally: - Docker: redirect_uri=https%253A%252F%252F... ❌ - Local: redirect_uri=https%3A%2F%2F... ✅ Setup:...

How to Retrieve Session in Next.js RSC Without Getting 401 (Next.js + Hono Integration)

Hi, I'm building a full-stack app using Next.js for the frontend and Hono.js for the backend, running on separate ports in development (localhost:3000 for Next.js and localhost:8787 for the Hono server with Better Auth). I’m using the following logic on the client side to get the current user:...

Type Error with zodValidator and arktypeValidator

Basically I have this ```ts import { arktypeValidator } from "@hono/arktype-validator"; import { type } from "arktype"; import { Hono } from "hono";...

Getting corrupted binary responses instead of JSON from Hono gateway service with axios

Hi everyone! I'm having an issue with my Hono-based API gateway that forwards requests to microservices. I’m receiving corrupted binary responses instead of the expected JSON when using axios or fetch from my React Native frontend. Problem: Requests return binary-like data instead of proper JSON: ```...

React Native / Expo

Hello i have Monorepo expo app and i want to use hono rpc client in my react app but if i try import it with this metro config i get this error ```js const { getDefaultConfig } = require("expo/metro-config"); const { withNativeWind } = require("nativewind/metro");...
No description

Inferring the response type of a handler

I'm trying to infer the return type of a route on my server. Any tips on what I'm doing wrong? ``` import type { Env } from "@/types"; import { createFactory } from "hono/factory"; import { InferResponseType } from "hono";...

JSX with no-value attribute

Using Datastar, it's convenient to create signals using <input data-bind-foo /> or <div data-signals-bar></div>. But Hono converts them to <input data-bind-foo="true" /> and <div data-signals-bar="true"></div>, causing datastar error. Is it possible to turn off that feature without using raw()?...

`args?` is blank despite using zValidator

Set up details Using Deno (2.4.2, the latest version) And all the other packages are also up-to-date (Hono 4.8.5, zod-validator 0.7.1, Zod 4.0.5) I'm getting the packages from NPM, not JSR...

How to Achieve Full Type-Safe Communication Between a Hono Server and a Next.js Client in a Monorepo

I have a Hono server running on port 8787 and a Next.js client on port 3000. Both are in a monorepo. How can I achieve full type safety between them? I also want the requests to be written in a very professional way,...

Discriminated Unions from AppType

Hi there! I had a question about the returned type of hc<typeof app>. I have an API route that returns 400 and { success: false, error: SomeTypes } . Generally I would expect this to create a discriminated union on result.ok or on body.success (or both!) but neither seems to work. This seems to be related to returning c.json() multiple times in my route, but in theory I would expect this to consolidate types. I've attached some screenshots as an example. In the last screenshot instead of success: boolean it should be a literal, success: false which would allow me to use it as a discriminate. Would love any insight folks have!...
No description

HTTP Status bug

Getting a weird bug when returning a response in my project for a post request. Previous get requests return data correctly, but this one is giving me problems for some obscure reason. This results in an Internal server error Error message: The status provided (0) must be 101 or in the range of [200, 599]...