Hono

H

Hono

This is the official Hono discord server for the community

Join

Using honox, bun, vite and using islands folder, Hot Reload doesn't work

for client side components changes, they do not get reloaded on browser, Am I missing some setting to enable that?

Nested form objects POST

My form has nested objects and array of objects. I name them as below - ``` <form method="post"> <div class="form-control mb-4">...

how check the param is present. const my_id = c.req.param('id')

Is there preferable way to check const my_id = c.req.param('id') is present in parameters of request?...

Bun Monorepo Hono RPC

I'm trying to setup hono rpc, but I'm not able to get the types or autocompletion for it. I did check to make sure the compiler options are set to strict: true but doesn't seem to work. If you don't mind checking https://github.com/nikevsoft/bun-monorepo what I'm doing wrong?...

CORS Issue

Im using hono x bun for my backend and next js for my front end. when i fetch the api it will return "has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource." i already set my cors settings, here i attached...
No description

Openapi query params

I'm experimenting with openapi docs. I have: ``` const paramsSchema = z.object({ entry_id: z.string().openapi({ param: {...

Using both `c.body` and `c.json` in an endpoint results in `response.json()` of `Promise<unknown>`

hi everyone, is there any way to get the response type working when i have endpoints that return multiple type of content based on status code? this is an example where it fails to infer the type ```ts export const routes = new Hono()...

Deno .env...?

Hello, I wonder if anyone could help me. I 'm having some trouble getting values from my .env file in my Deno project. Works fine with a Bun version but is there some special trick with Deno? I've granted permissions in the terminal and I'm using the Hono adapter env helper. (I'm new to Deno). Thank you for any advice you may have. #deno

Adding swagger to hono API

I want to add a swagger doc to my API and when I add middleware to any new OpenAPIHono instance the .openapi method disappears. ```ts /** * Creates a base instance of Hono with middleware....

Hono RPC

Hello 👋 techies! It's Alfred. I'm currently working on building a backend service with Bun and Hono. I'm facing some challenges with the Hono RPC. Can anyone help me out?

RPC type error - Unable to interop

Repro repo: https://codeberg.org/Dreamboat9222/ioMonorepo-Edgedb-Hono-Svelte In a monorepo, I have hono api in one package, and the ui (Svelte) in another and use EdgeDB as the database. It was working a couple of days ago, but I lost all intellisense abilities for 4 days so I was basically coding inside notepad 😂 (The issue is now fixed), but since then this stopped working. I also posted on the edgedb server, but I didn't receive any reply yet. Posting here in case someone have an idea on what is going wrong....

How to pass and validate cookies (server<>server) ? (RPC)

I use Sveltekit and hono as an external API. Most requests coming from the UI are done through XHR, but some requests (like token validation) is done from sveltekit server-side to hono api. - When the user logs in, a cookie is set on the client (secure, lax). - When the user close and re-open the site, the token is validated with a server hook. Sveltekit sees the cookies and make a request to hono, but hono doesn't see the cookies (obviously)....

SolidJS renderToString with Hono: Undefined or 'React not defined' error

Hi everyone, I'm trying to use SolidJS's renderToString function within a Hono server to generate SVG components, but I'm running into issues. The renderToString call always returns undefined, or I get a "React is not defined" error (if I change tsconfig.json to "jsxImportSource": "solid-js"). Has anyone successfully integrated SolidJS's JSX rendering with Hono or has ideas how to do so? If so, could you share how you resolved the JSX compilation for SolidJS? Thanks 🙂 ...

Integration testing with test client and HTTP only cookies

Hello, I have an API with HTTP only cookies built with Hono (Behind Next.js https://hono.dev/docs/getting-started/vercel). I tried to do some integration testing with Hono test client and vitest. I ran into a big issue that is my HTTP only cookies aren't send back to the server. It's normal since HTTP only behavior is handle by the browser and not Node or bun. So I was wondering what tooling or how could i do this integration testing. I want to run it in my CI CD. Any idea or recommendation is welcome ^^...

Accessing .dev.vars outside of context

I use CF Workers and Hono to create an API and to read the secret variables in the .dev.vars you have to go through the context (c) but I want to define my client for several globally because i need to use it in multiple routes, did you know how i can do it? .dev.vars: ``` APPWRITE_ENDPOINT=...

How to extend Hono's JWTPayload

I want to extend the default JWTPayload interface. ``` import type { JWTPayload } from 'hono/utils/jwt/types' ...

streamText only returning one chunk

```typescript chatApi.get("/test", async (c) => { const openai = new OpenAI({ apiKey: c.env.OPEN_AI_API_KEY, })...