Skip to content

Hard Zod dependency #113

@endel

Description

@endel

Hi there,

I noticed you're working on version 2.0, it would be nice to make the "zod" dependency actually optional, right now we'd get a runtime error if using the module without "zod" as dependency, see:

import { createEndpoint, createRouter } from "better-call";

const endpoint = createEndpoint("/item", { method: "GET" }, async (ctx) => {
   return "ok";
})

const router = createRouter({ endpoint })

Bun.serve({
    fetch: router.handler
})

This gives this error:

❯ bun run index.js
error: Cannot find package 'zod' from 'node_modules/better-call/dist/openapi.mjs'

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions