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

Module not found error: Can't resolve 'part:@sanity/desk-tool/structure

14 repliesLast updated: Nov 29, 2025

[NOT SOLVED]Hello everyone, hope you are all doing great. I have an issue with structure-builder and hope someone could give me a help with it. I was following
https://www.sanity.io/guides/getting-started-with-structure-builder , but I can't seem to make it work. Issue I am facing is :
Module not found: Error: Can't resolve 'part:@sanity/desk-tool/structure?'

I tried researching more about this module, but any help I found online didn't work for me. Could someone please aid me with this ?
AI Update

I can see you're running into a classic version mismatch issue! The error you're getting is because you're following a guide written for Sanity Studio v2, but you're likely using Sanity Studio v3 (or v4). The part: import system was completely removed in Studio v3, which is why you're getting that "Can't resolve" error.

The Solution

In Studio v3+, the import path has changed. Instead of:

// ❌ This is v2 syntax - won't work in v3+
import S from 'part:@sanity/desk-tool/structure-builder'

You need to use:

// ✅ This is v3+ syntax
import {structureTool} from 'sanity/structure'

How to Set Up Structure Builder in v3+

Here's the modern way to configure the Structure Builder:

1. Create a structure file (e.g., structure/index.ts or structure.ts):

import type {StructureResolver} from 'sanity/structure'

export const structure: StructureResolver = (S) =>
  S.list()
    .id('root')
    .title('Content')
    .items([
      S.documentTypeListItem('post').title('Blog Posts'),
      S.documentTypeListItem('author').title('Authors'),
      // Add more document types as needed
    ])

2. Import and configure it in your sanity.config.ts:

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

export default defineConfig({
  // ...your other config
  plugins: [
    structureTool({structure}),
    // ...other plugins
  ],
})

What Changed Between v2 and v3?

Updated Documentation

The guide you were following is outdated. For current documentation, check out:

The good news is that once you update your imports and configuration structure, most of your actual Structure Builder code (the S.list(), S.documentTypeListItem(), etc.) will work with minimal changes!

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