Skip to content

Unable to upgrade to zod@4 as a consumer of the npm package #11

@Nefleex

Description

@Nefleex

Reproduction Repository

https://github.com/Nefleex/meteor-rpc-types
zod4 branch

git clone https://github.com/Nefleex/meteor-rpc-types
cd meteor-rpc-types
git checkout zod4
meteor npm install
npm run typecheck

Description:

When a project uses zod@4.x, TypeScript reports type errors in meteor-rpc's library files.

Errors:

node_modules/meteor-rpc/lib/createMethod.ts(44,11): error TS2322: Type 'unknown' is not assignable to type 'output<Schema>'.
node_modules/meteor-rpc/lib/createModule.ts(29,52): error TS2345: Type 'input<Schema>' is not assignable to type 'output<Schema>'.

Likely Root Cause:

meteor-rpc has zod@^3.18.0 as a devDependency. Zod 4 introduced breaking changes to the z.input<T> and z.output<T> utility types, which meteor-rpc uses extensively.

Workaround:

Downgrade to zod 3.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions