Sanity embedded studio popup overlay flashing on save in production (Vercel)

7 replies
Last updated: Jan 28, 2026
Hi y’all. I have a weird issue that’s only happening in production. I have an embedded studio inside a Next.js app hosted on Vercel. Whenever a field uses a popup overlay for input, like an array, the overlay flashes and reloads on every background save. I attached a couple videos showing what I am describing. The first video is the production version, the second is the same version running locally. It’s extremely annoying, and each time it reloads the focus resets, so if you happen to be typing when it happens your text gets messed up. Really hurting the overall usability of the studio. Anyone ever run into anything like this? I am using Sanity 3.35.0, Next 14.1, and next-sanity 8.4.5.
AI Update

Good news! This exact issue was reported and fixed back in March 2024. The problem you're experiencing with the overlay flashing and reloading on every autosave in production is a known bug that was resolved in a Sanity Studio release.

The solution is simple: upgrade your Sanity package.

You mentioned you're on Sanity 3.35.0, and the fix was released around March 22, 2024 (likely version 3.36.0 or later). The issue was specifically in the sanity package, not next-sanity.

Run:

npm install sanity@latest
# or
yarn add sanity@latest

Then redeploy to Vercel, and the flashing overlay issue should be resolved.

Why this happens: The problem occurs specifically in production environments (like Vercel) because of how the embedded Studio handles re-renders during autosave. In production builds, certain optimizations or caching behaviors can trigger unmounting/remounting of overlay components (like array inputs, reference selectors, etc.) when the document saves in the background. This causes the flash you're seeing and the frustrating focus loss.

The Sanity team addressed this in their release by improving how the Studio maintains component state during background saves, preventing those overlays from being unnecessarily torn down and rebuilt.

Your code setup looks fine - having the Studio in a client component with 'use client' and using NextStudio from next-sanity is the correct approach. The dynamic theme loading from themer.sanity.build is also a common pattern and shouldn't be causing this issue.

After upgrading, if you're still experiencing problems (unlikely), you might also want to update next-sanity to the latest version, but based on the community discussion I found, the fix was specifically in the core sanity package and resolved the issue completely for the original reporter.

Show original thread
7 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?