
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe error you're encountering is because you have the Studio v2 version of sanity-plugin-media installed, which uses the deprecated Parts System (part:@sanity/base/* imports). These parts were completely removed in Studio v3.
The good news is that sanity-plugin-media does have a v3-compatible version—it's the same package name, but you need to ensure you're installing the correct version. Here's how to fix it:
Uninstall the old version:
npm uninstall sanity-plugin-mediaInstall the Studio v3 compatible version:
npm install sanity-plugin-media@studio-v3Alternatively, if the latest version is v3-compatible (which it should be now), you can use:
npm install sanity-plugin-media@latestUpdate your sanity.config.ts (or .js) file:
The plugin configuration syntax has changed for v3. Make sure you're importing and using it correctly:
import { defineConfig } from 'sanity'
import { media } from 'sanity-plugin-media'
export default defineConfig({
// ... other config
plugins: [
media()
// ... other plugins
]
})Clean install:
After updating, delete node_modules and package-lock.json, then run npm install fresh.
The key issue is that during migration, npm may have kept the v2 version of the plugin in your dependencies. By explicitly installing the @studio-v3 tag or @latest, you ensure you get the v3-compatible version that doesn't use the old parts system.
Additional note: If you're on an Enterprise plan, you might also want to explore Sanity's built-in Media Library feature, which is an organization-scoped DAM addon with enhanced capabilities like metadata management, versioning, and GROQ queries. But sanity-plugin-media works great for most use cases and is available on all plans.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store