Comments (9)
I see what you're saying, but as some light pushback:
- I've never seen this degree of incompatibility between patch versions of the same project (outside of an actual bug).
- This significantly hampers the ability to publish a library of prefab zod schemas which would be consumed and extended by multiple consumers (our use case).
npm
is explicitly designed to be able to handle various versions of a single package as sub-dependencies of direct dependencies, so the total incompatibility comes as a surprise in this case.
it's not clear what should be done about this.
That's totally fair — I don't have a solution either :)
If it's a "hard problem" to solve, so be it, but I'm sure it'll keep coming up, and it might be worth identifying the root cause and figuring out a medium-to-long-term solution.
from zod.
Having similar issue – zod
seems to be grinding down to a halt in a forever error loop when using 3.23.x
together with vee-validate/zod.
Downgrading to 3.22.4
solved the issue for now.
from zod.
I have this issue with 3.23.7
and 3.23.8
. Having to remain on 3.23.6
for now.
from zod.
I described a similar scenario here: #3429 (comment)
It seems to be related to the recursive definition of ZodError. As far as I can tell this isn't related to Zod 3.23 and can be replicated with almost any two previous versions of Zod (let me know if you have evidence to the contrary though).
As I mentioned in the other issue, it's not clear what should be done about this. There are breaking changes I can make that might mitigate the problem (changing the definition of ZodError). But really modern monorepo tools and package managers have systems to avoid dependency duplication for exactly these reasons.
from zod.
I am experiencing the same issue as well. We are dealing with a large schema that is causing a significant slowdown in the project, especially when importing the schema to our working file. We attempted to resolve the issue by downgrading to version 3.22.4, but it did not have any effect.
from zod.
I had the same issue here after upgrading to 3.23.X. Downgrading worked for me.
from zod.
I had the same issue in a mono repo with 2 packages using 3.23.6 and one using 3.23.5. I got them all on the same version and issue was fixed.
from zod.
Had the same issue with two repos 3.23.6 & 3.23.5. Updated 5 to 6, and the errors are gone.
from zod.
I have this issue with
3.23.7
and3.23.8
. Having to remain on3.23.6
for now.
This worked for me too, cheers! 🍻
from zod.
Related Issues (20)
- [Bug]: ZodFormattedError type breaks for ReadonlyArrays.
- safeParse not working server sider with z.union() : Error: Attempted to call indexOf() from the server but indexOf is on the client. HOT 1
- If object with nested refine fails, it doesn't apply transform before superRefine, causing superRefine to not be typesafe
- ZodReadonly missing methods to manipulate schema shape HOT 1
- Generic type function converting property with a default value to optional
- Lowercase ULIDs should be considered valid ULIDs HOT 1
- Valid union-of-partials data does not parse even though it conforms to one (or more) of the union members HOT 1
- Changelog.md looks abandoned since version 3.10 HOT 1
- Request to support 'hostname' string validation HOT 5
- Zod .partial() no longer able to use programmatically HOT 1
- Overloaded function return schema with z.union
- Add support for `example` HOT 1
- Refine removes null from schema HOT 2
- Add `invalid_literal` ZodIssueCode to documentation
- Schema evolutions using zod?
- Support for curly braces around UUID/GUID
- ZodObject with generic key (i.e. [key: string]: xx) and specific key (i.e. {debug: xx}) don't _seem_ to work as expected
- zod parsing bug HOT 2
- Enum parsing error: TypeError: Cannot read private member from an object whose class did not declare it (codesandbox repro included) HOT 1
- PanelOn: z.coerce.boolean(), is generating an optional field PanelOn. How can we require it?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zod.