-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleIssue will be reviewed by Core Team and a relevant label will be added as soon as possible
Description
Describe the bug
The zodResolver type declaration in @primeuix/forms imports ParseParams from zod:
import type { ParseParams, Schema } from 'zod';Zod v4 removed ParseParams from its public API (replaced by ParseContext). When a project uses @primeuix/forms with Zod v4 and skipLibCheck: false, TypeScript reports:
error TS2305: Module '"zod"' has no exported member 'ParseParams'.
The devDependencies in @primeuix/forms pin "zod": "^3.23.8", confirming it was built against Zod v3.
Reproducer
mkdir test-zod-resolver && cd test-zod-resolver
npm init -y
npm install @primeuix/forms@0.1.0 zod@4tsconfig.json:
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"skipLibCheck": false,
"noEmit": true
},
"include": ["*.ts"]
}test.ts:
import { zodResolver } from '@primeuix/forms/resolvers/zod';Run: npx tsc --noEmit
Result:
node_modules/@primeuix/forms/dist/resolvers/zod/index.d.mts(1,21):
error TS2305: Module '"zod"' has no exported member 'ParseParams'.
Root cause
- Zod v3:
parse(data, params?: InexactPartial<ParseParams>)whereParseParams = { path, errorMap, async } - Zod v4:
parse(data, params?: ParseContext)whereParseContext = { error?, reportInput?, jitless? } ParseParamsno longer exists in Zod v4's public API
Suggested fix
Replace ParseParams with Parameters<T['parse']>[1], which automatically infers the correct type from whichever Zod version is installed. Zero runtime impact.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleIssue will be reviewed by Core Team and a relevant label will be added as soon as possible