Hono

H

Hono

This is the official Hono discord server for the community

Join

Websocket subprotocol results in Error: The script will never generate a response

Websockets - sending subprotocols (auth token smuggling) results in Error: The script will never generate a response. Client: ``` const ws = new WebSocket(wsUrl, "potato");...

How to add credentials to a Hono client?

I see hono documentarion unfortunately lacks a lot of information on how to use it appropriately, and It's no different with this piece of information, so I'd like to know how to or if it's even possible to make authentication via cookies. Can anyone help me?

Post method not working with Queues on CF Worker

Hono version: 4.6.20 Wrangler version: 3.107.2 I've tried a lot but fetch function inside queue is not executing in the worker both deployed version and local dev server. ...

I'm looking for more clarity on client components

I've tried following the documentation but I can't seem to get a hono project working with the client components helper. https://hono.dev/docs/guides/jsx-dom can anyone provide a comprehensive snippet on how to set this up? 🥺...

Using @hono/auth-js with one API server (auth) and one web server (front) ?

Hey, hope Hono fans are doing well, I'm wondering if it's possible to use a distant API (not on the same hostname) with authjs ? I've seen multiple examples with @hono/auth-js but they are always relying on the vite proxy server to serve the api on the same host as the frontend server. Example usages of the @hono/auth-js lib : - https://github.com/divyam234/next-auth-hono-react...

Hono + Bun + Better Auth 404 error when using app.route

Hey, I'm trying to setup a hono server like this, but when I call the /api/auth/ok endpoint I got a 404. In fact I'm also using a app.route() in my entryfile. A very strange behavior break the "/api/auth/**" matching Working version ```ts...

Help with REGEX doesnt work on route path definition

I have this route definition: ``` app.on(["POST", "GET"], "/api/auth/**", (c) => { return auth.handler(c.req.raw);...

Configuring Storybook with Hono

Hey, I am trying to configure storybook with Hono, is there an easy way of doing this? Thanks!...

TSX layout / templating question

- is there a way to link a static style sheet from the server side tsx components?? i've been trying, searching and proompting, what am i missing... - im using server side tsx to render html and i want to link a style sheet instead of using the jsx css helper, can i just link a stylesheet like normally? main.tsx...

relative pathname in Request not working on POST request

Using the pathname in a GET request everything works fine. Code: ```js test("GET: all car brands", async () => { const res = await app.request("/api/brand");...

What is the difference between `Zod OpenAPI` and `Hono OpenAPI`?

From reading the docs I can't tell why I should use one as opposed to the other. Can I use both? If so, how?

Can't get the RPC typing

Hey ! Hope you're doing well, I have an issue with the RPC types, how can I manage to get the client types ? ```ts // hc.ts import router from "./root";...

Image uploaded to S3 cannot be displayed when run on Lambda

I'm trying to upload images to S3 via AWS Lambda using Hono, but when I open the image url it shows The image cannot be displayed because it contains error My Setup: - Frontend: SvelteKit, sending a multipart/form-data request with the image. - Backend: AWS Lambda with Hono ...

HonoX change entry file

In the new HonoX, how can I change the entry file from app/server.ts to src/server.ts? there is an entry option in the honox vite plugin but that doesn't work

No Types for RPC with abstracted routes

I'm not getting any type hints from my Hono RPC client. I know there are warnings not to use the factory method, but as far as I knew this was the only way to have abstracted routes, which I find pretty important for organizing many routes. ```ts type Env = { Variables: {...

How can I stream a video in hono?

I want also to put a range header when user wants to put a specific time of video

Get `auth` session when API endpoint is called from a server component

```ts import { Hono } from 'hono' import { verifyAuth } from '@hono/auth-js' import { zValidator } from '@hono/zod-validator' import { db } from '@/db'...

How can I use hono/jsx templates to send Emails via Nodemailer?

I'm not sure if this is possible currently... I would like to render a JSX or TSX component without having to set up a route. I want to render a JSX component to an html string with one function call, so I can pass the string to nodemailer. How can I achieve this with hono?...

Is there a simple way to bundle the directory served by serveStatic into a single file executable?

So, I'm not 100% sure if I should be asking this here or on bun support, as it may be more of a bun issue, but I figured that you guys would be the most likely to need to do this. I've tried the recommendation from the bun documentation to embed directories (https://bun.sh/docs/bundler/executables#embed-directories) but this gives me an error about not being able to find an entrypoint there. So far I've only been able to include my static files by manually adding them to the directory containing the executable, but I'm very interested in the alleged ability of bun to include all the files inside the executable....

Loading routes from Cloudflare KV?

I need to store routes in a dynamic fashion (be it env or KV) since routes will controlled from a third party -- is there a way to load these without adding a "default" catchall route that then has access to env/kv context from where the routes can be loaded? Optimally I can avoid a route.all(...) that has the logic to fetch this and then add additional routes.
Next