Skip to content

Type instantiation is excessively deep and possibly infinite. ts(2589) #1574

@uncomplexity

Description

@uncomplexity

Which middleware has the bug?

@hono/zod-openapi

What version of the middleware?

"@hono/zod-openapi": "^1.1.5",

What version of Hono are you using?

"hono": "^4.10.6",

What runtime/platform is your app running on? (with version if possible)

Node

What steps can reproduce the bug?

import { serve } from "@hono/node-server";
import { swaggerUI } from "@hono/swagger-ui";
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { Scalar } from "@scalar/hono-api-reference";

const app = new OpenAPIHono();

app.openapi(
  createRoute({
    method: "get",
    path: "/hello",
    responses: {
      200: {
        description: "Respond a message",
        content: {
          "application/json": {
            schema: z.object({
              message: z.string(),
            }),
          },
        },
      },
    },
  }),
  (c) => {
    return c.json({
      message: "hello",
    });
  },
);

app.doc("/doc", {
  info: {
    title: "An API",
    version: "v1",
  },
  openapi: "3.1.0",
});

app.get("/", (c) => c.text("Hello world!"));

app.get("/hello", (c) => {
  return c.json({
    message2: "Hello world!",
  });
});

app.get("/scalar", Scalar({ url: "/doc" }));

app.get("/swagger", swaggerUI({ url: "/doc" }));

serve({ fetch: app.fetch, port: 8080 }, (info) => {
  console.log(`Listening on http://localhost:${info.port}`);
});

What is the expected behavior?

No response

What do you see instead?

Image

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions