Issue with Sanity/Vision plugin and error message
I can see from your configuration that you're using definePlugin where you should be using defineConfig for your studio configuration file. This is likely why the Vision plugin suddenly stopped working.
The Problem
You're wrapping visionTool() in definePlugin, but definePlugin is for creating custom plugins, not for configuring your studio. Your studio configuration file (sanity.config.js or sanity.config.ts) should use defineConfig instead.
Your current code:
definePlugin({ // ❌ Wrong context
plugins: [
visionTool(),
],
})Should be:
defineConfig({ // ✅ Correct
plugins: [
visionTool(),
],
})The Correct Setup
Here's how your studio configuration should look:
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
export default defineConfig({
name: 'default',
title: 'My Studio',
projectId: 'your-project-id',
dataset: 'production',
plugins: [
structureTool(),
visionTool(),
],
schema: {
types: [/* your schema types */]
}
})Understanding the Difference
defineConfig: This is the main configuration function for your Sanity Studio. It sets up your entire studio instance including project ID, dataset, plugins, schema, and other global settings.definePlugin: This is used when you're creating a custom plugin to share or reuse. You'd only use this if you were building your own plugin package, not when configuring which plugins to use in your studio.
Why It Stopped Working Today
If this was working before and suddenly broke, check if something changed in your config file. Perhaps during an update or refactor, defineConfig was accidentally changed to definePlugin. Check your version control history to see what changed.
Once you fix the configuration to use defineConfig, both version 3.8.2 and 3.9.1 of the Vision plugin should work normally. The plugin itself is stable—the issue is just that it's not being loaded properly into your studio due to the incorrect configuration wrapper.
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.