
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on your description, it sounds like you're experiencing a 404 error when running your Sanity Studio locally, and you've identified that it works when you switch to a different project ID. Here are some steps to troubleshoot this issue:
Since changing the projectId to another project makes it work, the issue is likely related to how your current project ID is configured. Here's what to verify:
1. Confirm your Project ID is correct
Double-check that the projectId in your sanity.config.js file matches your actual Sanity project. You can find your correct Project ID in:
2. Check your configuration file
Make sure your sanity.config.js has the correct projectId:
import { defineConfig } from 'sanity'
export default defineConfig({
projectId: 'your-actual-project-id', // Make sure this matches your project
dataset: 'production', // or 'development'
// ... rest of your config
})3. Verify environment variables
If you're using environment variables, ensure they're properly set up. Remember that Studio environment variables must be prefixed with SANITY_STUDIO_:
# .env.development
SANITY_STUDIO_API_PROJECT_ID=your-project-id
SANITY_STUDIO_API_DATASET=productionThen reference them in your config:
export default defineConfig({
projectId: process.env.SANITY_STUDIO_API_PROJECT_ID,
dataset: process.env.SANITY_STUDIO_API_DATASET,
})Dataset permissions: The project ID might be correct, but if your dataset doesn't exist or you don't have access to it, you'll get errors. Verify that:
Authentication: Make sure you're logged into the correct Sanity account locally. Try running:
sanity logout
sanity loginClear cache and reinstall: Sometimes configuration issues can be resolved by clearing your cache:
rm -rf node_modules
npm installSince your Studio works fine on Netlify but fails locally with a 404, and switching to another project ID makes it work, the most likely culprit is either a typo in the project ID or a mismatch between your local configuration and what's deployed. Remember that project IDs are not secret information, so you can safely check them in your deployed code to compare with your local setup.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store