Open heggemsnes opened 3 days ago
I've encountered this problem as well, but with a boolean type. To make TypeGen work, I had to comment out all instances of this custom type, run the TypeGen commands, then manually add the correct type definitions to the output file (which defeats the purpose).
Describe the bug
Using a field like
Somewhere directly like:
Causes error on schema extract
To Reproduce
Steps to reproduce the behavior:
Check my forked repo from the clean next.js template: https://github.com/heggemsnes/sanity-template-nextjs-clean
I've changed the schemaTypes to the examples before.
Add a valid project ID and run
npm run extract-types
Expected behavior
This is valid Sanity code (I think?) and works fine in the studio. Useful for reusable validations etc.
Which versions of Sanity are you using?
@sanity/cli (global) 3.62.0 (latest: 3.63.0) @sanity/assist 3.0.8 (up to date) @sanity/eslint-config-studio 4.0.0 (up to date) @sanity/icons 3.4.0 (up to date) @sanity/vision 3.61.0 (latest: 3.63.0) sanity 3.62.2 (latest: 3.63.0)
What operating system are you using?
MacOS 14.3.1
Which versions of Node.js / npm are you running?
10.2.4 v20.11.0