How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Studio crashes when creating new document type

5 repliesLast updated: Nov 29, 2025

The Desk tool crashed
An uncaught exception in the Desk tool caused the Studio to crash.
I just created a new document type, and the studio loads until I try to create a document, when I get the error above.
Code inside thread (to follow)
AI Update

Based on the error you're describing, the Desk tool crash when creating a new document typically indicates a schema configuration issue. Since you mentioned you just created a new document type, here are the most common causes and solutions:

Common Causes

1. Missing Required Properties Every document type needs at minimum a name and type property. Make sure your schema definition includes both:

defineType({
  name: 'yourDocumentType',
  type: 'document',
  // ... other properties
})

2. Invalid Field Definitions Fields within your document also need proper name and type properties. According to Sanity's schema documentation, you should always use the defineField helper:

fields: [
  defineField({
    name: 'title',
    type: 'string',
    title: 'Title'
  })
]

3. Circular References or Invalid Types If you're referencing other document types or using custom types, make sure they're properly defined and don't create circular dependencies.

4. Validation Rules Errors If you've added validation rules, syntax errors in those functions can crash the Studio:

validation: (rule) => rule.required() // Make sure this is properly formatted

Debugging Steps

defineType({
  name: 'yourDocumentType',
  type: 'document',
  fields: [
    defineField({
      name: 'title',
      type: 'string'
    })
  ]
})
import { defineType, defineField } from 'sanity'

When you share the code you mentioned, look specifically for:

The browser console error will usually point to the exact line and property causing the crash, which will help narrow down the issue quickly!

Show original thread
5 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