fix(core,shadcn-svelte): make zod a peer-only dependency - #303
Closed
ctate wants to merge 1 commit into
Closed
Conversation
zod was listed in both dependencies (^4.3.6) and peerDependencies
(^4.0.0) in @json-render/core and @json-render/shadcn-svelte. Package
managers can resolve the dependencies entry to a second zod copy
distinct from the consumer's (e.g. a lockfile that pinned 4.3.x while
the app uses 4.4.x). zod v4 intentionally embeds a version literal in
its types (_zod.version.minor), so two copies are structurally
incompatible and consumers hit:
The types of 'props._zod.version.minor' are incompatible.
Type '4' is not assignable to type '3'.
plus 'type instantiation is excessively deep' errors and tsc memory
blowups from the cross-copy structural comparison.
Moving zod to devDependencies (keeping the ^4.0.0 peer range) means the
consumer's zod is always the only copy. Verified with npm and pnpm
consumers on zod 4.4.3: one zod resolved, repro from #297 typechecks.
Workspace builds and all 1021 unit tests pass under zod 4.3.6 and 4.4.3.
Fixes #297
Contributor
Closed
| zod: | ||
| specifier: ^4.3.6 | ||
| version: 4.3.6 | ||
| version: 4.4.3 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #297.
@json-render/coreand@json-render/shadcn-sveltelistedzodin bothdependencies(^4.3.6) andpeerDependencies(^4.0.0). Package managers can resolve thedependenciesentry to a second zod copy distinct from the consumer's (e.g. a lockfile that pinned 4.3.x while the app uses 4.4.x). zod v4 intentionally embeds a version literal in its types (_zod.version.minor), so two copies are structurally incompatible and consumers hit:plus
type instantiation is excessively deeperrors and tsc memory blowups from the cross-copy structural comparison.Fix
Move
zodtodevDependenciesin both packages, keeping the^4.0.0peer range. The consumer's zod is then always the only copy.Verification
@json-render/solid@0.19.0withzod@4.4.3and a nested 4.3.6 copy under core (same error text as the issue).pnpm pack, installed in fresh npm and pnpm consumers withzod@4.4.3: one zod resolved (pnpm why zod→ "Found 1 version"), the issue's repro (schema.createCatalog+ registry) typechecks cleanly.