Schema type "*" not defined error when creating document

10 replies
Last updated: Nov 29, 2025
Hi! When I create a document in sanity studio, I met some issue.
This document has the schema type *, which is not defined as a type in the local content studio schema.
Let me know any hint please.
Thanks for your time.
🎉
AI Update

This error happens when you have a document in your Content Lake that references a schema type that doesn't exist in your current Studio configuration. The asterisk (*) in the error message is a placeholder for the actual schema type name.

Here are the most common causes and solutions:

1. Missing schema type in your config

The schema type needs to be defined and registered in your sanity.config.js file. Check that you've included the schema type in your configuration:

import { defineConfig } from 'sanity'
import { deskTool } from 'sanity/desk'
import mySchemaType from './schemas/mySchemaType' // Import your schema

export default defineConfig({
  // ... other config
  schema: {
    types: [mySchemaType] // Make sure it's registered here
  }
})

2. Schema was removed but documents still exist

If you previously had a schema type defined and then removed it, documents of that type still exist in your dataset. You have two options:

  • Add the schema back: Re-add the schema type definition to your config
  • Delete the orphaned documents: Use the Management API or Vision plugin to find and delete documents with that type

3. Working across different branches/environments

If you're working with multiple developers or environments, someone may have created documents with a schema type that hasn't been synced to your local Studio yet. Pull the latest schema definitions from your repository.

4. Typo in the schema type name

Double-check that the name field in your schema definition matches exactly what's being referenced. Schema type names are case-sensitive.

To identify which specific schema type is causing the issue, you can use the Vision plugin to query your documents and see what types exist:

*[!(_id in path("_.**"))] | order(_type) { _type }

This will show you all document types in your dataset, helping you identify any mismatches with your local schema configuration.

Hope this helps! 🎉

Show original thread
10 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?