Module not found: Can't resolve 'part:@sanity/base/document-actions/resolver
This error indicates you're running into a Studio v2 vs v3 compatibility issue. The error Can't resolve 'part:@sanity/base/document-actions/resolver' is happening because you're trying to use a tutorial or code written for Sanity Studio v2, but your project dependencies are pulling in Studio v3 packages (or vice versa).
The part: syntax was part of the old Parts System in Studio v2, which was completely removed in Studio v3. This is why the module can't be resolved - it literally doesn't exist in v3.
Here's how to fix it:
Option 1: Upgrade to Studio v3 (Recommended)
If the tutorial is outdated, you should migrate to Studio v3. The modern equivalent would be:
Make sure you're on Studio v3 by checking your
package.json- you should have"sanity": "^3.x.x"(not v2)In Studio v3, the desk tool is imported differently:
import {deskTool} from 'sanity/desk'- Document actions in v3 are configured in your
sanity.config.ts/jsfile:
import {defineConfig} from 'sanity'
import {deskTool} from 'sanity/desk'
export default defineConfig({
// ... other config
plugins: [
deskTool({
// document actions configuration here
})
]
})Check out the official v2 to v3 migration guide for complete migration steps.
Option 2: Use Studio v2 (Not recommended - support ended Dec 2023)
If you absolutely need to follow that specific v2 tutorial:
- Downgrade to Studio v2 in your
package.json:"sanity": "^2.x.x" - Run
npm installoryarn install
However, Studio v2 support ended in December 2023, so this isn't advisable for production projects.
Quick check:
Run npm list sanity to see which version you actually have installed. If it's v3 and the tutorial is v2, that's your mismatch. Look for an updated v3 version of the tutorial, or follow the migration guide to convert the v2 code patterns to v3.
Show original thread8 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.