Failed to Load Resource: the Server Responded with a Status of 404 (Not Found)
This is a common issue that usually happens when something else is already running on port 3333, or there's a configuration issue with your Studio setup. Here's how to troubleshoot and fix it:
Quick Solutions
1. Check if port 3333 is already in use
The most common cause is another process using port 3333. To fix this:
- On macOS/Linux: Run
lsof -ti :3333 | xargs kill -9to kill any process using that port - On Windows: Use Task Manager to find and end the process using port 3333
2. Run Studio on a different port
You can specify a different port when starting the dev server:
npx sanity dev --port 3334Or if you're using npm scripts:
npm run dev -- --port 33343. Configure a permanent custom port
If you want to always use a different port, edit your sanity.cli.ts (or create one if it doesn't exist):
import {defineCliConfig} from 'sanity/cli'
export default defineCliConfig({
api: {
projectId: 'your-project-id',
dataset: 'production'
},
server: {
port: 3334
}
})Check Your Setup
Make sure you're:
- Running the correct command (
npx sanity devornpm run dev) - In the correct directory (where your
sanity.config.tsfile is located) - Have installed all dependencies (
npm install)
BasePath Configuration
If you've configured a custom basePath in your sanity.config.ts, you'll need to access the Studio at that path. For example, if you set basePath: '/studio', you'd navigate to http://localhost:3333/studio instead of just http://localhost:3333.
The "Cannot GET /" error often appears when the Studio is configured with a basePath but you're trying to access the root URL. Check your config file for any basePath settings.
Still Having Issues?
If none of these work, try:
- Deleting
node_modulesand runningnpm installagain - Making sure you're on Node.js 20 or higher (Studio v4 requirement)
- Checking the terminal output for any error messages when starting the dev server
According to the Sanity documentation on localhost:3333, this 404 error typically indicates either something else is running on port 3333 or the Studio server hasn't started properly.
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.