-
Notifications
You must be signed in to change notification settings - Fork 5
Compile error with zod and mjs files #113
Comments
Looking through the "Used by" repos, I found this: This indeed fixes it for me. Looks like an undocumented Sanity feature. If so, maybe it should be documented in the README? |
I do use something like that and I really dislike that it's required. If you can think of a proper solution, pull requests are definitely welcome (and encouraged!). From what I understand, sanity v3 will handle |
It would be a breaking change, but I could treat zod like I do fakerjs, where it's not actually bundled with the package, but you'd bring your own zod: const type = document(/* ... */);
- type.parse(somevalue);
+ type.parse(zod, somevalue); I honestly would prefer to go the other way, ie bundle fakerjs for mocks. Feels a lot like exposing implementation details. The only reason I'm ok with it for fakerjs is mainly because it's rarely needed for production. |
I'm personally just using it for the schema typings atm. However, it seems like those features will become the main draw once v3 is released. |
I was getting this error. I implemented the proposed fix above and it went away. Is it still required that I use the fix above or am I missing something? I don't believe I saw this in the docs, am I wrong? |
I haven’t added this to the docs yet, something I need to do. |
My webpack.sanity.js looks like this:
And I'm getting this error:
Any idea? 🤔 |
Honestly, not really figuring this out. The weird thing is that installing |
I think #171 might make this irrelevant, not sure. |
If anyone in this issue is using sanity v3, are you able to update to v2.0.0 of this library and see if you still have this issue? @han-tyumi @ElektrikSpark @Waltari10 |
Hey! So, I moved to Sanity v3 following this example nextjs-blog-cms-sanity-v3. I have not tried to implement this library yet on my rewrite because with all the bugs I have experienced so far between the Next.js 13 app directory and Sanity v3 upgrade, I have tried to keep things simple. Will let you know if get around to implementing this library again. |
I have initialized a clean Sanity repository with
sanity-typed-schema-builder
installed.I export the following:
and then import it:
When running
sanity start
, I run into:Looks like a Webpack/Babel issue to me, but I'm not sure why I'd be seeing it if it's working for others.
So I feel like I may be missing some configuration here?
But I also don't see an easy way to modify the Sanity configuration, so 🤷♂️ .
The text was updated successfully, but these errors were encountered: