Issue with "sanity.json" file not found in plugin "@sanity/vision"
This error is happening because you're mixing Sanity Studio v2 and v3 dependencies in your monorepo. The @sanity/vision plugin you have installed is the newer v3 version, but something in your setup is trying to run it with Studio v2 commands or dependencies that expect the old sanity.json configuration file.
Here's what's happening: Sanity Studio v3 completely removed sanity.json in favor of JavaScript/TypeScript configuration files (sanity.config.js or sanity.config.ts). The v3 vision plugin doesn't have a sanity.json file because it doesn't need one - but your setup is looking for it.
How to fix it:
Option 1: Use Studio v3 (recommended)
Make sure you're fully on Studio v3:
- Check your
package.json- you should have"sanity": "^3.x.x"(not separate@sanity/core,@sanity/base, etc.) - Delete your
sanity.jsonfile if it exists - Create a
sanity.config.ts(or.js) file in your Studio directory:
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
export default defineConfig({
name: 'default',
title: 'My Project',
projectId: 'your-project-id',
dataset: 'production',
plugins: [
structureTool(),
visionTool(),
],
schema: {
types: [/* your schema types */],
},
})- Use
npm run devorsanity devinstead ofsanity start
Option 2: Use Studio v2 (not recommended - it's deprecated)
If you need to stay on v2 for some reason:
- Downgrade vision to v2:
npm install @sanity/vision@^2 - Keep your
sanity.jsonfile - Use
sanity start
The v2 to v3 migration is straightforward for most projects. Check out the official migration guide for a complete walkthrough. In a monorepo setup, make sure all your Sanity dependencies are aligned to the same major version across packages.
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.