Sanity Studio returns "Studio not found" error when users create account

4 replies
Last updated: Jan 29, 2021
Hi! when people create account in my sanity studio, they redirect to a message like this:
{"statusCode"
:404,"error":"Not Found","message":"Studio not found"}
Should i do something?
AI Update

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:

The easiest approach is using Sanity's built-in hosting. From your Studio directory, run:

sanity deploy

This will:

  • Build your Studio automatically
  • Deploy it to a *.sanity.studio domain (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:

  1. Build your Studio:

    sanity build

    This generates static files in a dist folder.

  2. Deploy the dist folder to your hosting provider:

    • For Netlify: Set build command to sanity build and publish directory to dist
    • For Vercel: Configure similar build settings in your deployment config
  3. 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 thread
4 replies
Are they going to the correct deployment domain? Could it be that you self-host your studio but the deployment URL is not set up on manage.sanity.io yet? πŸ™‚
More info:
https://www.sanity.io/docs/deployment#configuring-the-studio-url-displayed-on-sanityio-manage-00c4a1bd7a44
Yes! i added it! thank you πŸ™‚
user M
im going to drive you crazy!
Are they going to the correct deployment domain? Could it be that you self-host your studio but the deployment URL is not set up on manage.sanity.io yet? πŸ™‚
More info:
https://www.sanity.io/docs/deployment#configuring-the-studio-url-displayed-on-sanityio-manage-00c4a1bd7a44

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.

Was this answer helpful?