Hi everyone. I'm new to using Sanity and having a bit of an issue with local development, and wondering if someone is able to point me in the right direction. The issueis...
Based on the documentation and a similar case in the Sanity community, this appears to be a port conflict issue rather than a browser cache or service worker problem with Sanity Studio.
First, verify your project configuration:
Check your sanity.config.ts (or sanity.config.js) file to confirm it has the correct projectId and dataset specified in the configuration:
import { defineConfig } from 'sanity'
export default defineConfig({
projectId: 'your-project-id',
dataset: 'production',
// ... other config
})You can also check your sanity.cli.ts file to ensure the API configuration is correct:
import { defineCliConfig } from 'sanity/cli'
export default defineCliConfig({
api: {
projectId: 'your-project-id',
dataset: 'production'
}
})Kill any processes using port 3333:
The most likely cause is that another process is running on port 3333 and serving content from your old project. You'll need to terminate it:
- macOS/Linux: Run
lsof -ti :3333 | xargs kill -9in your terminal - Windows: Use
netstat -ano | findstr :3333to find the process ID, thentaskkill /PID <process-id> /F
Try a different port:
As a quick workaround, you can run your Studio on a different port using:
sanity start --port=3334Or configure it permanently in your sanity.cli.ts:
import { defineCliConfig } from 'sanity/cli'
export default defineCliConfig({
api: {
projectId: 'your-project-id',
dataset: 'production'
},
server: {
port: 3334
}
})Restart your machine:
In a similar reported case, the issue was resolved by restarting the machine, which cleared a stray process running the old project on the same port.
The issue you're experiencing is most likely a port conflict where another process is serving content on localhost:3333, rather than a browser or Sanity Studio caching issue. The steps above should help you identify and resolve the conflict.
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.