zValidator Middleware Error

I have literally only implemented the example

import { zValidator } from "@hono/zod-validator";
import { Hono } from "hono";
import { z } from "zod";

const app = new Hono();

const route = app.post(
  "/posts",
  zValidator(
    "form",
    z.object({
      body: z.string(),
    })
  ),
  (c) => {
    const validated = c.req.valid("form");
    // ... use your validated data
  }
);

And is giving me this typescript error
 Argument of type 'MiddlewareHandler<Env, string, { in: { form: { body: string | File; }; }; out: { form: { body: string; }; }; }>' is not assignable to parameter of type 'H<BlankEnv, "/posts", BlankInput, HandlerResponse<any>>'.
Was this page helpful?