Sanity Studio returns "Studio not found" error when users create account
The "Studio not found" 404 error typically means your Sanity Studio isn't properly deployed or accessible at the URL where Sanity is trying to redirect users after authentication. This is fundamentally a deployment issue, not a configuration problem.
What's Actually Happening
When someone creates an account or logs into your Sanity project, Sanity needs to redirect them to your Studio. If your Studio isn't deployed anywhere, or if the deployment failed, users will hit this 404 error because there's literally no Studio for them to access.
The Solution: Deploy Your Studio
You have two main options for deploying your Studio:
Option 1: Deploy to Sanity's Hosting (Recommended)
The easiest approach is using Sanity's built-in hosting. From your Studio directory, run:
sanity deployThis will:
- Build your Studio automatically
- Deploy it to a
*.sanity.studiodomain (you'll choose a unique hostname during first deployment) - Handle SSL certificates and hosting infrastructure
- Deploy your schema for use with AI features and other platform capabilities
This is the recommended method because it's zero-config and integrates seamlessly with Sanity's platform features.
Option 2: Self-Host Your Studio
If you need to host your Studio on your own infrastructure (Netlify, Vercel, etc.), you'll need to:
Build your Studio:
sanity buildThis generates static files in a
distfolder.Deploy the
distfolder to your hosting provider:- For Netlify: Set build command to
sanity buildand publish directory todist - For Vercel: Configure similar build settings in your deployment config
- For Netlify: Set build command to
Configure CORS origins: Once deployed, add your Studio's URL to your project's CORS origins settings at manage.sanity.io under Settings > API > CORS Origins. This allows your self-hosted Studio to communicate with Sanity's APIs. Make sure to check "Allow credentials" if you're using authentication tokens.
Why This Error Happens
The error occurs because Sanity's authentication system needs a destination to send users to after they log in. If you've only initialized a Studio locally (with sanity init or npm create sanity@latest) but haven't deployed it anywhere, there's no public URL for users to access. They authenticate successfully, but then get redirected to... nowhere.
Verify Your Deployment
After deploying, make sure you can access your Studio directly by visiting the deployment URL in your browser. If you can see and use your Studio, new users should be able to access it after creating their accounts.
If you're still seeing issues after deploying, double-check that your deployment actually succeeded and that the URL is publicly accessible (not behind authentication or a firewall).
Show original thread4 replies
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.