-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with 3.23.0
combined with package that uses 3.22.4
#3429
Comments
@colinhacks Could you look into this? |
There's not a lot I can do in this case. You really don't want multiple versions floating around. Usually this happens in monorepos when dependencies aren't properly updated across all packages. If there's a problematic package that pinned itself to a specific Zod version, then they'll need to fix that upstream. What package is this? Do you have a replication? |
It's a private package, but is this then not considered breaking? Replication is thus not possible. |
All sorts of bad things happen when you have multiple versions of a package in your project, even if there are no breaking changes between the two. This kind of error would happen with any two versions of Zod, even if they're identical. You can try this yourself. Zod 3.22.4 and 3.22.5 had literally no changes (due to an accidental patch release). In your package.json: "dependencies": {
"zod-a": "npm:zod@^3.22.4",
"zod-b": "npm:zod@3.22.5"
} And in a import type * as za from "zod-a";
import * as zb from "zod-b";
const schema: za.ZodType<any, any, any> = zb.string();
// Type 'Zod.ZodIssue[]' is not assignable to type 'import("/Users/colinmcd94/Documents/projects/scratch/node_modules/zod-b/lib/ZodError").ZodIssue[]'. It's possible the recursive nature of |
I am getting this error when using
z
from3.23.0
with a package that is fixed on3.22.4
:When rolling back to
3.22.4
everything works again (with reloading the vscode ts-servers).This goes for anything, not just
ZodNumber
.The text was updated successfully, but these errors were encountered: