Skip to content

Sanity Translation Error: "Invalid property value" - String vs Object Type Mismatch

9repliesLast updated: Nov 13, 2026

Hello, I have an issue when trying to add translations or multiple language in sanityI follow this official sanity tutorial on youtube:
https://www.youtube.com/watch?v=Rk70FSgTJeQ Minute: 1: 07

On my sanity, it gives an error:


Invalid property value
The property value is stored as a value type that does not match the expected type.


Developer info
The value of this property must be of type object according to the schema.

Mismatching value types typically occur when the schema has recently been changed.

The current value (string)
But type value that I put is already 'object', I'm not sure what else is the issue, this is my schema.js, will appreciate for any help:


{
      name: 'blog',
      type: 'document',
      title: 'Blog',
      fields: [
        {
          name: 'title',
          title: 'Title',
          type: 'object',
          fields: [
            {
              title: 'English',
              name: 'en',
              type: 'string'
            },
            {
              title: 'French',
              name: 'fr',
              type: 'string'
            }
          ]
        },
      ]
}
AI Update

The error doesn't mean the schema is wrong. The document was saved while title was a plain string, and Sanity doesn't change existing content when you edit a schema. The Studio sees a string where the schema now expects an object ({en, fr}), so it flags the value. To fix it, clear or convert the old value. Your schema can stay as it is.

Fix the existing value

One or a few documents in development: clear the old value from the field in the Studio (look for a reset option on the field's warning), or delete the test documents and create new ones. New documents are saved with the object structure.

Real content you want to keep: convert the strings with a migration. Changing a schema never changes or deletes existing content, so you have to do it explicitly. Create a migration with npx sanity@latest migrations create, then:

// migrations/localize-blog-title/index.ts
import {defineMigration, at, set} from 'sanity/migrate'

export default defineMigration({
  title: 'Convert blog title string to {en, fr} object',
  documentTypes: ['blog'],
  migrate: {
    document(doc) {
      if (typeof doc.title === 'string') {
        return [at('title', set({en: doc.title}))]
      }
      return []
    },
  },
})
# Dry run (default): prints the patches without applying them
npx sanity@latest migrations run localize-blog-title
# Apply the changes
npx sanity@latest migrations run localize-blog-title --no-dry-run

Back up the dataset first with sanity datasets export.

Render it in the frontend

title is now an object, so you can't render it directly. Read title.en or title.fr in your component, or select the language in GROQ:

*[_type == "blog"]{ "title": title[$lang] }

Choose a localization approach

Today's Studio uses defineConfig and defineType from the sanity package. The v2 part:@sanity/base/schema-creator setup is gone. The localization docs describe two approaches, and you can use both in one project:

The Course Platform Demo is a Studio and Next.js example with an internationalized schema and localized queries. For machine translation, see Translating content with AI Assist.

Show original thread
9 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions