Getting Uncaught Error cannot create property ‘validation’ on string ‘string’ when I have fields property as well as a validation property. If I get rid of either of those...

1 replies
Last updated: Jan 17, 2021

Getting Uncaught Error cannot create property ‘validation’ on string ‘string’ when I have fields property as well as a validation property. If I get rid of either of those it works, but together it’s causing problems. Any idea what gives?

Jan 17, 2021, 12:01 AM

Could be some bug in the schema validation - I'll see if I can reproduce.
You can't combine

type: 'string'
with
fields
, though - are you looking for
type: 'object'
?

Jan 17, 2021, 1:56 AM

Sanity.io: Get the most out of your content

Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Give your team exactly what they need to edit and publish their content with the customizable Sanity Studio. Get real-time collaboration out of the box. Sanity.io comes with a hosted datastore for JSON documents, query languages like GROQ and GraphQL, CDNs, on-demand asset transformations, presentation agnostic rich text, plugins, and much more.

Don't compromise on developer experience. Join thousands of developers and trusted companies and power your content with Sanity.io. Free to get started, pay-as-you-go on all plans.