Deploys should add files, not swap them
Why a visitor's open tab breaks right after you ship a Next.js app you host yourself, what frontend client skew is, and the one-folder fix.
Someone has your site open. You ship an update. They click a button, and the page turns into an error.
The old version was fine. The new one is fine. It broke because their tab was open while you deployed. You'll probably never see it: after a deploy, you refresh. Your visitors don't.

What the visitor sees
The page says "This page couldn't load". In DevTools, the console shows:
ChunkLoadError: Failed to load chunk /_next/static/chunks/04leuz213l84f.jsand the Network tab shows a 404 for that file.
It has a name: frontend client skew
Version skew is when two parts that depend on each other run different versions for a while. Malte Ubl explains it best. Here the two parts are the open tab (still on the old version) and your server (already on the new one).

Why the file is gone
Two good Next.js features meet one bad deploy.
Now the deploy:
1git pull
2npm run build # deletes the old .next folder first
3pm2 restart appThe old file names are gone. The open tab asks for one, the server answers 404, and the page breaks. Nothing in Next.js is wrong. The deploy swaps the files instead of adding to them.
What other people do

How NextDeploy does it
Each app has one folder, shared_static. Before a new release gets traffic, its static files are copied in. Old files stay. Same name means same contents, so nothing collides.
Caddy serves every /_next/static/* request from that folder:
handle_path /_next/static/* {
root * /path/to/app/shared_static
header Cache-Control "public, max-age=31536000, immutable"
file_server
}The old tab asks for its old file, and it's still there: 200, not 404.

So the folder doesn't grow forever, each deploy keeps the files the five newest releases use and deletes the rest.

What this doesn't fix
It fixes missing files only. An old tab can still call a Server Function the new build doesn't have, or use page data it prefetched from the old version. Those need the deploymentId reload or Vercel-style version locking.

The rule
Deploys should add files, not swap them.
A two-minute check: open your site in a private window, deploy, then click something that loads code lazily. If it breaks, look at what your deploy does to .next/static.
NextDeploy is open source: github.com/aynaash/NextDeploy.
Sources