Sanity Studio stuck on "loading items" after fresh install
Don't give up on Sanity just yet! This "loading items" issue is almost always a CORS configuration problem, and it's super easy to fix. Here's what's happening and how to solve it:
The Problem
When you run sanity start locally, your Studio is trying to fetch data from Sanity's cloud APIs, but your browser is blocking these requests because http://localhost:3333 (or whatever port you're using) isn't registered as an allowed origin in your project settings.
The Solution
You need to add your localhost URL to your project's CORS origins:
- Go to manage.sanity.io
- Select your project
- Navigate to Settings → API → CORS Origins
- Click Add CORS origin
- Enter
http://localhost:3333(use the exact port number you see in your terminal) - Important: Check the "Allow credentials" checkbox
- Click Save
That's it! Refresh your Studio and you should see your content types load properly.
Why This Happens
Sanity Studio runs in your browser and makes API calls to Sanity's cloud. For security reasons, browsers block cross-origin requests unless the server (Sanity) explicitly allows them. Fresh projects don't have localhost configured by default, so you need to add it manually. The CORS Origins feature is a security configuration that controls which domains can access your Sanity project data with credentials.
Additional Tips
- If you change ports (like
localhost:3000), you'll need to add that as a separate CORS origin - When you deploy your Studio to production, you'll need to add that domain too
- Make sure to include the protocol (
http://orhttps://) - it matters! - The "Allow credentials" checkbox is required for authenticated requests, which Studio uses
This is one of the most common "gotchas" for new Sanity users, so you're definitely not alone. Once you've added the CORS origin, everything should work smoothly. Let us know if you're still having issues after adding the CORS origin!
Show original thread18 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.