Sanity Navigation Empty on Vercel Deploy but Works in Dev - Network Error

8 replies
Last updated: Jan 28, 2026
Hello.I have been trying to find a solution for this. I have inherited a site based on
sanity.io and nextJs. The current navigation was hardcoded and I have made the navigation on sanity using schema. Navigation appears in a burger menu. Everything is working fine in the dev. But as soon as I deploy the site on vercel, the burger menu is empty.After deploying with vercel, I am getting this Network error :
Network error while attempting to reach https://....
While there is no such error in the dev.
Thanks in advance.
AI Update

This is a classic CORS (Cross-Origin Resource Sharing) issue that happens when deploying to Vercel. Your navigation works locally because localhost is likely already in your allowed CORS origins, but your Vercel domain isn't.

When you deploy to Vercel, your site gets a new domain (like yoursite.vercel.app), and Sanity blocks requests from domains that aren't explicitly allowed in your project settings. This is why you're seeing the network error when trying to fetch your navigation data.

Here's how to fix it:

  1. Go to manage.sanity.io
  2. Select your project
  3. Navigate to Settings → API settings
  4. Under CORS Origins, click Add CORS origin
  5. Add your Vercel production domain (e.g., https://yoursite.vercel.app)
  6. Make sure "Allow credentials" is checked if your site uses authentication

Important for Vercel preview deployments:

If you're also deploying preview branches (like yoursite-git-branch-name.vercel.app), you have two options:

  • Add a wildcard origin: https://*.vercel.app (this allows all your Vercel preview deployments)
  • Add each specific preview URL individually (more secure but less convenient)

After adding the origins:

The changes take effect immediately—just refresh your deployed site and your burger menu should populate with the navigation data.

This is one of the most common deployment issues with Sanity + Vercel, and once you've added your domains to the CORS origins list, everything should work exactly like it does in development. The Sanity CORS documentation has more details if you need additional configuration options.

Show original thread
8 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.

Was this answer helpful?