Skip to content

fix: bump zod to ^3.25 for MCP SDK zod/v3 export compatibility#10926

Open
xiaoshuai wants to merge 1 commit into
shadcn-ui:mainfrom
xiaoshuai:main
Open

fix: bump zod to ^3.25 for MCP SDK zod/v3 export compatibility#10926
xiaoshuai wants to merge 1 commit into
shadcn-ui:mainfrom
xiaoshuai:main

Conversation

@xiaoshuai

Copy link
Copy Markdown

Fix: pnpm dlx shadcn fails with ERR_PACKAGE_PATH_NOT_EXPORTED

Problem

Running pnpm dlx shadcn@latest init crashes with:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v3' is not defined by "exports" in .../zod/package.json
imported from .../@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js

Root Cause

@modelcontextprotocol/sdk@1.29.0 (a dependency of shadcn) unconditionally imports zod/v3 in its zod-compat.js. The ./v3 subpath export was introduced in zod 3.25, but packages/shadcn/package.json declares "zod": "^3.24.1", allowing pnpm to resolve zod@3.24.1 which does not have this export.

The monorepo lockfile happens to resolve to zod@3.25.76 so it works in development, but the published npm package's ^3.24.1 range causes pnpm dlx to pick 3.24.1 in a clean environment.

Dependency chain

shadcn
├── zod: "^3.24.1" → resolves to 3.24.1 (missing ./v3 export)  ← this PR fixes
└── @modelcontextprotocol/sdk@1.29.0
    ├── zod: "^3.25 || ^4.0"
    └── zod-compat.js → import from 'zod/v3'  ← requires zod >= 3.25

Fix

Bump the zod specifier from ^3.24.1 to ^3.25 so the minimum resolved version always includes the zod/v3 subpath export that MCP SDK requires.

@modelcontextprotocol/sdk@1.29.0 imports from 'zod/v3' in zod-compat.js,
which is only exported by zod >= 3.25. The ^3.24.1 range allowed pnpm to
resolve zod@3.24.1 which lacks this subpath export, causing
ERR_PACKAGE_PATH_NOT_EXPORTED when running via pnpm dlx.
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@xiaoshuai is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant