Skip to content

fix: correct Zod v4 array and promise type extraction#165

Merged
chmaltsp merged 1 commit intomainfrom
fix/zod4-array-promise-types
Jan 20, 2026
Merged

fix: correct Zod v4 array and promise type extraction#165
chmaltsp merged 1 commit intomainfrom
fix/zod4-array-promise-types

Conversation

@chmaltsp
Copy link
Copy Markdown
Contributor

Summary

  • Fix getArrayType to use def.element for Zod v4 (instead of def.type which is now the string "array")
  • Fix getPromiseType to use def.innerType for Zod v4 (instead of def.type which is now the string "promise")

This fixes the "Cannot use 'in' operator to search for '_zod' in array" error when using nextlove generators with Zod v4.

Test plan

  • Build passes
  • Test with seam-connect Zod 4 migration branch

🤖 Generated with Claude Code

In Zod v4:
- Array element type is in `def.element`, not `def.type` (which is now the string "array")
- Promise inner type is in `def.innerType`, not `def.type` (which is now the string "promise")

This fixes the "Cannot use 'in' operator to search for '_zod' in array" error
when using nextlove generators with Zod v4.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@chmaltsp chmaltsp merged commit 9ee52c6 into main Jan 20, 2026
2 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 20, 2026
## [3.0.1](v3.0.0...v3.0.1) (2026-01-20)

### Bug Fixes

* correct Zod v4 array and promise type extraction ([#165](#165)) ([9ee52c6](9ee52c6))
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