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

9 replies
Last updated: Jan 28, 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

This is a common issue when migrating existing content to a new internationalized schema structure. The error occurs because you already have documents in your dataset where title was stored as a simple string, but your new schema expects title to be an object with en and fr properties.

Here's what's happening: When you change a field from type: 'string' to type: 'object', Sanity doesn't automatically migrate your existing data. Any blog documents created before the schema change still have title: "some string value" instead of title: { en: "...", fr: "..." }.

Solutions

Option 1: Use Sanity's document internationalization plugin (Recommended)

Instead of manually creating nested object structures, use the @sanity/document-internationalization plugin. This is the official, supported approach for document-level translations and creates separate documents per language with proper references:

npm install @sanity/document-internationalization

Then configure it in your sanity.config.ts:

import {documentInternationalization} from '@sanity/document-internationalization'

export default defineConfig({
  plugins: [
    documentInternationalization({
      supportedLanguages: [
        {id: 'en', title: 'English'},
        {id: 'fr', title: 'French'}
      ],
      schemaTypes: ['blog']
    })
  ]
})

Your schema would then have a simple language field:

{
  name: 'blog',
  type: 'document',
  title: 'Blog',
  fields: [
    {
      name: 'title',
      title: 'Title',
      type: 'string' // Back to a simple string
    },
    {
      name: 'language',
      type: 'string',
      readOnly: true,
      hidden: true
    }
  ]
}

Option 2: Keep your object approach but migrate existing data

If you prefer the nested object structure from the tutorial, you need to migrate your existing documents. You can do this through the Vision plugin in your Studio or create a migration script:

  1. Temporarily revert title to type: 'string' to access your old data
  2. Create a migration to convert title: "Old Title" to title: { en: "Old Title", fr: "" }
  3. Update your schema back to the object structure

Option 3: Start fresh

If you're still in development without important content:

  1. Delete the existing blog documents from your dataset
  2. Keep your new schema
  3. Create new documents with the correct structure

Option 4: Use a different field name

Add a new field like localizedTitle with your object structure, leaving the old title field intact. This lets you gradually migrate content without breaking existing documents.

The tutorial approach works for new projects, but the document internationalization plugin is generally more robust for production use as it provides better querying capabilities, clearer separation between language versions, and works well with features like AI Assist for translation.

Show original thread
9 replies

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.

Was this answer helpful?