chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
578 stars 43 forks source link

Is the requirement to use Zod 3.21.1 or below gone? #250

Closed willscottrod closed 2 days ago

willscottrod commented 1 month ago

I saw the issue in the documentation here has been closed and merged with zod =< 3.23.0

Has this been confirmed as a fix for the issue?

I have tested locally and everything seems to be working fine including generation and usage but I don't know what it could have broken so would be great to know.

If it indeed fixes the issue, only a documentation update is required.

willscottrod commented 1 month ago

After a bit of testing, it looks like it works initially but at build time it looks like it creates a memory leak.

I get back this error:

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 00007FF73B5EDA2B node::SetCppgcReference+15611
 2: 00007FF73B55AFE4 DSA_meth_get_flags+86548
 3: 00007FF73C1BE351 v8::Isolate::ReportExternalAllocationLimitReached+65
 4: 00007FF73C1AAF76 v8::Function::Experimental_IsNopFunction+2918
 5: 00007FF73BFF4DA0 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+31760
 8: 00007FF73B88568D BIO_ssl_shutdown+189
 9: 7FF8000000000000

Testing versions with memory leak: "zod": "^3.23.8", "zod-prisma-types": "^3.1.6"

Versions that complete build as before.

"zod": "^3.21.1",
"zod-prisma-types": "^3.1.6"

Is this an issue with zod-prisma-types or zod itself? I couldn't find any open issues on zod relating to this.

chrishoermann commented 1 month ago

@willscottrod didyou figure out what the problem was? I never encountered this issue in my projects. 🤔

willscottrod commented 4 weeks ago

@chrishoermann sorry for the delay in getting back to you. Turns out it was just an internal error with my packages being too big haha. After cleaning up my packages and some tech debt, it built perfectly with ^3.23.8 but haven't tested runtime yet.

I'm still using the zod ^3.21.1 for now just to be safe but will move versions up soon and run some thorough tests and let you know if I find any issues with it.