Zod validator not working

I'm following the tutorial here to set up Hono with Zod validation, but I'm getting the type error seen in the screenshot. Below is my code. import { type Context, Hono } from "hono"; import { zValidator } from "@hono/zod-validator"; import { z } from "zod"; import { find as findTimezone } from "geo-tz"; const app = new Hono().basePath("/api2"); app.get( "/timezone", zValidator( "query", z.object({ latitude: z.number().gte(-90).lte(90), longitude: z.number().gte(-180).lte(180), }), ), (c: Context) => { const { latitude, longitude } = c.req.valid("query"); return c.json({ timeZone: findTimezone(latitude, longitude)[0] }); }, ); Deno.serve({ port: parseInt(Deno.env.get("BACKEND2_PORT") as string) }, app.fetch);
Hono Stacks - Hono
Web framework built on Web Standards for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.
No description
3 Replies
this_chord
this_chordOP4w ago
I'm using Deno btw
this_chord
this_chordOP4w ago
GitHub
Type of zod-validator not compatible with Context in Deno · Issue #...
What version of Hono are you using? 4.4.2 What runtime/platform is your app running on? Deno What steps can reproduce the bug? Creating a .ts file and using the simple example from documentation: i...
this_chord
this_chordOP4w ago
I added the npm: specifiers as recommended here: https://github.com/honojs/hono/issues/1216, but now I'm getting this issue (see screenshot)
GitHub
Issues · honojs/hono
Web framework built on Web Standards. Contribute to honojs/hono development by creating an account on GitHub.
No description
Want results from more Discord servers?
Add your server