Error setting up custom desk structure with Structure Builder

42 replies
Last updated: Jan 28, 2026
Hey everyone! I was just trying to setup a custom desk strcuture following this article here: https://www.sanity.io/guides/getting-started-with-structure-builder But I always get this error:
Any ideas? Thanks!
AI Update

I can see you're running into a common issue when setting up custom desk structure! The article you're following is likely for an older version of Sanity Studio. There have been some important changes in recent versions that are causing your error.

The Problem

In Sanity Studio v3+, the Structure Builder setup has changed from earlier versions. The most common issues are:

  1. Import path changed: The old 'sanity/desk' import is now 'sanity/structure'
  2. Plugin renamed: deskTool() is now structureTool()
  3. Function signature: The structure function receives the Structure Builder as a parameter differently

The Solution

Here's how to set it up correctly for modern Sanity Studio:

In your sanity.config.ts:

import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'

export default defineConfig({
  // ... your other config
  plugins: [
    structureTool({
      structure: (S) =>
        S.list()
          .title('Content')
          .items([
            S.documentTypeListItem('post').title('Posts'),
            S.documentTypeListItem('author').title('Authors'),
            // ... more items
          ])
    }),
    // ... other plugins
  ],
})

Or extract it to a separate file (structure/index.ts):

import type {StructureResolver} from 'sanity/structure'

export const structure: StructureResolver = (S) =>
  S.list()
    .title('Content')
    .items([
      S.documentTypeListItem('post').title('Posts'),
      S.documentTypeListItem('author').title('Authors'),
    ])

Then import it:

import {structureTool} from 'sanity/structure'
import {structure} from './structure'

export default defineConfig({
  plugins: [
    structureTool({structure}),
  ],
})

Key Changes to Remember

  • ✅ Import from 'sanity/structure' (not 'sanity/desk')
  • ✅ Use structureTool() (not deskTool())
  • ✅ The structure function signature is (S) => S.list()... or (S, context) => S.list()...

The Structure Builder documentation has been updated with all the current syntax, so that's your best reference going forward!

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