Closed angelhdzdev closed 7 months ago
Read the guide again and noticed the examples use z
from zod
, not from mongoose-zod
. :) nice!
Also, forgot to call setup()
so when I would have tested my app at runtime later it would have failed haha🤦♂️. I've been only working on it on the types system.
But I tested and not calling setup still causes the "strange" mongoose error.
I get this strange issue when using
z
namespace frommongoose-zod@0.1.2
package. If I use it fromzod@3.22.4
package (which is a peer dep ofmongoose-zod
), it's all good!This was driving me nuts for 1 day. I was just using a Zod schema as I normally do in a Vue (Nuxt) component to use the parse method to validate the forms.
This is my schema:
Vue component:
I did a lot of steps based on the assumption it was a mongoose issue, installing mongoose explicitly, reinstalling all deps, deleting
.nuxt
to generate the types and Vue components from scratch, sigh...Until I realized the error is only present when using the
z
namespace frommongoose-zod
.Any info will be appreciated.