Unknown type: mux.video error when installing Mux plugin
The "Unknown type: mux.video" error happens because the Mux plugin hasn't been properly registered in your Sanity Studio configuration. This is a common issue when following Mux's documentation, as they don't clearly mention this crucial step that's specific to how Sanity plugins work.
Here's what you need to do:
1. Install the plugin package (you've probably already done this):
npm install sanity-plugin-mux-input2. Register the plugin in your sanity.config.ts (or .js)
This is the critical step that's missing. You need to import and add the plugin to your config:
import {defineConfig} from 'sanity'
import {muxInput} from 'sanity-plugin-mux-input'
export default defineConfig({
// ... your other config options
plugins: [
muxInput(), // Add this line
// ... your other plugins
],
})3. Now you can use the mux.video type in your schema
export default {
name: 'movie',
type: 'document',
fields: [
{
name: 'video',
type: 'mux.video', // This will now be recognized
}
]
}4. Restart your dev server
Stop your Sanity Studio dev server completely and restart it for the changes to take effect.
Once you've registered the plugin in sanity.config.ts, Sanity will recognize the mux.video type and you'll be able to see the Mux credentials popup when you try to upload a video.
The confusion here is that Mux's own documentation assumes you know how Sanity plugins work, but if this is your first plugin, it's not obvious that every plugin needs to be registered in the config file. You can find the correct installation steps in Sanity's plugin documentation.
Show original thread7 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.