Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change Site Theme
Sanity logo

Documentation

    • Overview
    • Platform introduction
    • Next.js quickstart
    • Nuxt.js quickstart
    • Astro quickstart
    • React Router quickstart
    • Studio quickstart
    • Build with AI
    • Content Lake
    • Functions
    • APIs and SDKs
    • Visual Editing
    • Blueprints
    • Platform management
    • Dashboard
    • Studio
    • Canvas
    • Media Library
    • App SDK
    • Content Agent
    • HTTP API
    • CLI
    • Libraries
    • Specifications
    • Changelog
    • User guides
    • Developer guides
    • Courses and certifications
    • Join the community
    • Templates
Help articles
Overview

  • Array items resolve to same JSON type
  • Studio Performance Issues Caused by legacy HTTP protocols
  • Error: Value of type "object" is not allowed in this array field
  • AVIF
  • Experimental feature: Spaces
  • Client API CDN configuration
  • Total attribute count exceeds limit
  • Desk is now Structure
  • Invalid configuration for cross dataset reference
  • Missing or duplicate context error
  • Sanity Studio v2 is deprecated
  • React Compiler and Sanity
  • Specify API version for studio client
  • Why give schema types a title?
  • Array type has a invalid value for property "of"
  • React 19 and Sanity
  • Schema: Lift anonymous object types
  • Reference type has a invalid value for property "to"
  • Incorrect location for reference options
  • Invalid part syntax
  • Asset metadata field
  • Warning: userStore.currentUser is deprecated
  • CLI errors
  • Renamed plugin sanity-plugin-vision
  • Part name format
  • Array member type name is the same as a global type
  • Changes in block schema customization properties
  • How to migrate from date to richDate
  • Invalid shape of predefined choices
  • JS Client: Promise Polyfill
  • Introducing the document type
  • Unable to get a ref to an input component
  • Authenticating the CLI when running remotely
  • Outdated modules
  • Upgrade studio packages
  • Block Content rendering: Image materializing
  • Structure: Document schema type required
  • Parts: Declare vs implement
  • Incorrect options declaration in reference
  • Block type cannot be used outside of array
  • Structure: Node ID required
  • Structure: List items must be an array
  • Installing Node.js
  • Structure: Action or intent required
  • Object type has a invalid value for fields
  • `studioHost` and `externalStudioHost` properties deprecated
  • Schema type is ES Module but imported through require
  • Structure: Invalid list item
  • Structure: Query provided where filter is expected
  • Structure: List item IDs must be unique
  • Given type name is a reserved type
  • Structure: Schema type not found
  • API versioning
  • Migrating the legacy webhook behavior to GROQ-powered Webhooks
  • Schema type is invalid
  • Input component is missing a required prop
  • Structure: Title is required
  • Structure: Filter is required
  • Import: Asset file does not exist
  • Input component is missing a required method
  • Implementing non-overridable part
  • Structure: Item returned no child
  • How to migrate your block text schema for the new definition of inline objects
  • Structure: Schema type is required
  • How to migrate from blocks spans to block children
  • Array type cannot contain array member
  • Using tokens in the browser
  • GraphQL
  • Array member type name conflicts with built-in type
  • Source vs. compiled paths
  • Import: Asset has different target than source
  • Using global studio client without specifying API version
  • Structure: Action and intent are mutually exclusive
  • Upgrade React
  • Plugin is missing a sanity.json file
  • Structure: Document ID required
  • Incompatible combination of params and filter
  • Using listener with tokens is not supported in browsers
  • Schema type is missing a required property
  • API versioning in Javascript Client
  • Upgrade version of studio package
  • Slug: `slugifyFn` renamed
  • Renamed plugin @sanity/date-input
  • Specify API version when using custom document list filters
  • Migration Cheat Sheet: Studio v2 to v3
  • Migrating from Studio v2
  • Function Timeout
  • Functions rate limit
  • Configure TypeGen
  • Studio v3 to v4
  • Email addresses show [email protection]

On this page

Previous

Help and troubleshooting

Next

Studio Performance Issues Caused by legacy HTTP protocols

Was this page helpful?

On this page

  • Example of problematic schema
  • How to fix
Help articlesLast updated February 10, 2026

Array contains multiple types that resolve to the same JSON type

  • Article
  • Changelog
    New

This warning appears when you have an array type where multiple members resolve to the same underlying JSON type (e.g., both string and text resolve to JSON type "string"). When Sanity stores array data, it uses the JSON type to serialize values. If multiple array members share the same JSON type, Sanity cannot distinguish between them at runtime. For example, if an array allows both string and text items, there's no way to know which type a given string value was originally intended to be when reading the data back.

Example of problematic schema

defineField({
  name: 'content',
  type: 'array',
  of: [
    {type: 'string', name: 'heading'},
    {type: 'text', name: 'paragraph'},  // Both resolve to JSON "string"
  ],
})

Both string and text (as well as url and email) resolve to the JSON type "string". This means we have no way to tell them apart when the document is read.

How to fix

You have two options:

  • Option 1: Use only one primitive type per JSON typeIf you only need one string-based type in your array, remove the duplicate:
defineField({
  name: 'content',
  type: 'array',
  of: [
    {type: 'string'},
  ],
})
  • Option 2: Wrap primitives in object typesIf you need different string-based inputs with different behaviors, wrap them in named object types:
defineField({
  name: 'content',
  type: 'array',
  of: [
    {
      type: 'object',
      name: 'heading',
      title: 'Heading',
      fields: [{name: 'value', type: 'string'}],
    },
    {
      type: 'object',
      name: 'paragraph',
      title: 'Paragraph',
      fields: [{name: 'value', type: 'text'}],
    },
  ],
})
  • This gives each item a distinct _type property that Sanity can use to distinguish between them.
defineField({
  name: 'content',
  type: 'array',
  of: [
    {type: 'string', name: 'heading'},
    {type: 'text', name: 'paragraph'},  // Both resolve to JSON "string"
  ],
})
defineField({
  name: 'content',
  type: 'array',
  of: [
    {type: 'string'},
  ],
})
defineField({
  name: 'content',
  type: 'array',
  of: [
    {
      type: 'object',
      name: 'heading',
      title: 'Heading',
      fields: [{name: 'value', type: 'string'}],
    },
    {
      type: 'object',
      name: 'paragraph',
      title: 'Paragraph',
      fields: [{name: 'value', type: 'text'}],
    },
  ],
})