You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> npm run extract-types
> [email protected] extract-types
> sanity schema extract --enforce-required-fields
❌️ Failed to extract schema, with enforced required fields
Error: Type "externalLink" not found
at convertSchemaType (~/Documents/GitHub/sanity-template-nextjs-clean/studio/node_modules/@sanity/schema/lib/_internal.js:120:11)
at createObject (~/Documents/GitHub/sanity-template-nextjs-clean/studio/node_modules/@sanity/schema/lib/_internal.js:125:63)
at convertBaseType (~/Documents/GitHub/sanity-template-nextjs-clean/studio/node_modules/@sanity/schema/lib/_internal.js:64:83)
at ~/Documents/GitHub/sanity-template-nextjs-clean/studio/node_modules/@sanity/schema/lib/_internal.js:58:18
at Array.forEach (<anonymous>)
at Object.extractSchema (~/Documents/GitHub/sanity-template-nextjs-clean/studio/node_modules/@sanity/schema/lib/_internal.js:54:33)
at main (~/Documents/GitHub/sanity-template-nextjs-clean/studio/node_modules/sanity/lib/_internal/cli/threads/extractSchema.js:10:195)
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
The text was updated successfully, but these errors were encountered: