Blank page after deploy? Find the cause in ten minutes.
A blank page is almost always an error the browser will show you, or a file that never arrived. Open the console, read the first error, and match it to one of six causes. Then the three changes that stopped it happening to our own client hub.

In short
- A blank page usually means the page’s code crashed while starting, or the files it needs didn’t load. React removes the whole page when an error goes uncaught.
- Open the live page, press F12, and read the first red error in the Console. Then reload with the Network tab open and look for 404s.
- The usual causes: the page and the server on different versions, a setting missing from the live build, a wrong base path or deleted files, no fallback for refreshes, a build that didn’t run, or a content security policy.
- Our own client hub went blank this way on 5 October. Three changes stopped it: build before restarting, draw only what the page knows, and a Reload note instead of a blank page.
01The short answer
A blank page is an error you haven’t read yet
When a site or app shows a white page after a deploy, one of two things has almost always happened: its JavaScript threw an error while starting, or the files it needs never arrived. React’s own docs say that if an error is thrown while drawing the page and nothing catches it, React removes the whole page from the screen1. The page looks empty, but the browser has the error, and it will show it to you.
These are the usual causes, in the order we’d check them:
- An error at start-up, often because the page and the server are now different versions, or a setting the page needs is missing from the live build.
- The page’s files return 404, because of a wrong base path, or because the deploy deleted old files that an open page still asks for.
- Every address but the home page fails on refresh, because the host has no fallback to index.html.
- The build didn’t run, or the host published the wrong folder.
- A content security policy blocks your scripts.
- The builder’s preview has something the live app doesn’t, common with apps made in Lovable or Replit.
02Ten minutes
Find which one it is
Open the live address in a private window, so your own cache and sign-in don’t hide anything. Then open the browser’s developer tools: F12 or Ctrl+Shift+I on Windows and Linux, Cmd+Option+I on a Mac2.
1. Read the Console
The Console tab reports the errors the browser hit while running the page’s code2. Read the first red error; the ones after it often follow from it. It names the file and the line.
2. Reload with the Network tab open
The Network tab lists every file the page asked for. A 200 means it arrived. A 404 means it couldn’t be found where the page asked, often a wrong path or a file that never got uploaded2. Look at the .js and .css files first.
3. Match what you saw
- An error like “Cannot read properties of undefined” means the code met data it didn’t expect: the page and the server out of step, or a missing setting. See 03 below.
- A 404 on a .js or .css file means a base path or old files. See 04 below.
- The home page works and a refresh anywhere else gives 404 means there’s no fallback. See 04 below.
- No error and no 404, but an old version or nothing at all points at the build. See 05 below.
- An error or an issue naming Content Security Policy points at the policy. See 05 below.
- Fine in your builder’s preview, blank when live means the two differ. See 06 below.
03Start-up errors
The page and the server don’t match, or a setting is missing
Two versions at once
Vercel’s docs call this version skew: different versions of your app running in the browser and on the server, causing errors. Their example is a new deployment that changes the shape of the data, which older pages don’t expect3. It happens whenever the page and the server go live at different moments: a server restarted before the page was rebuilt, or a visitor who kept the old page open. It’s what blanked our own client hub, as you’ll see in 07 below.
The fix is to ship both together. On Vercel’s Pro and Enterprise plans, Skew Protection sends an open page’s requests to the deployment that served it3.
A setting the live build doesn’t have
Build tools write the page’s settings into its code when it’s built. By default Vite passes only variables whose names start with VITE_ to the page, written in at build time; a variable without the prefix is undefined in the browser4. Next.js does the same with NEXT_PUBLIC_, and once the app is built it no longer responds to changes in those variables5.
So a setting you added to your host after the last build isn’t in the live page yet. On Vercel, a change to an environment variable applies only to new deployments, and a variable has to be set for the environment you build, Production or Preview6. Compare the names in your host’s settings with the names in your code, prefix included, then redeploy.
04Files and addresses
The files or the address return 404
A .js or .css file returns 404
The base path. If the site lives under a folder rather than at the root, Vite has to be told with its base option, and then rewrites every file path to match7. For a GitHub Pages site at username.github.io/repo/, Vite’s docs say to set base to /repo/8.
Old files after a deploy. A host may delete the previous deployment’s files. Anyone who loaded the page before the deploy is still running the old code, and when it asks for one of the old files, the request fails7. Vite fires a vite:preloadError event when that happens, and its docs show reloading the page there. They also say to serve the HTML file with Cache-Control: no-cache, or browsers keep using a page that points at the old files7.
The home page works. A refresh anywhere else gives 404.
A single-page app draws every address from one index.html. Open /pricing directly, and the host looks for a file at that address, finds none and returns 404. On Netlify the fix is one rewrite rule, /* /index.html 200, usually the last rule in the file9. On Vercel, a Vite single-page app needs a rewrite in vercel.json from /(.*) to /index.html before deep links work10. Cloudflare Pages falls back to index.html by itself, unless the project has a 404.html at the top level11.
05The build
The build didn’t run, the wrong folder went live, or a policy blocks the scripts
The build
A Vite app needs a build step before it can be deployed, and the build goes into a folder called dist by default8. Netlify deploys only the files in the publish directory you set12, and Cloudflare Pages’ preset for React with Vite runs npm run build and publishes dist13. Skip the build, or point the host at the wrong folder, and it serves something other than your app: an older build, or source files the browser can’t run.
Open the deploy log and check that the build ran and finished. Then check that the folder the host publishes is the folder the build writes.
The content security policy
A content security policy tells the browser where scripts may come from, and blocks scripts from anywhere else. If it has a default-src or script-src rule, inline scripts don’t run unless they carry a nonce or a hash14. A new script host, or an inline script a release added, can stop the page from starting. Chrome’s Issues panel lists Content Security Policy violations15.
06Preview and live
Fine in the builder’s preview, blank when live
Builders like Lovable and Replit run your preview in a different place from your live app, with different settings. When the preview works and the live app doesn’t, look there first.
- Lovable: the live site keeps showing the copy you last published. Accepting a draft changes the database, file storage and backend functions on the live app at once, while visitors see the new pages only after you publish, so Lovable’s advice is to publish right after you accept16. That’s the page and the backend out of step again. In apps created from 13 May 2026, a secret you change reaches the preview at once and the live app only after you publish again17.
- Replit: the published app reads its own production secrets, under Publishing, Adjust settings, Production app secrets. Replit says to review them, especially if testing and live use different credentials. Secrets aren’t available at all in Static Deployments18.
Our guide to a Lovable app that works in preview but not after you publish goes through Lovable’s settings one by one.
07From our work
Our own client hub went blank after a deploy
Our own client hub is a React app built with Vite, plus a server. The server runs straight from its code, so restarting it puts new server code live at once. The page is served from built files, and those change only when someone builds them.
On 5 October 2026 we merged a change that added a new section to the hub’s Settings screen, and the merge restarted the server. Nobody rebuilt the web app. So the new server told the page about a section the old page had never heard of. The page looked up that section’s icon, found nothing, and crashed reading ‘icon’ of undefined. Nothing caught the error, so React removed everything1, and the page went blank.
The hub already had one guard: when a deploy removed a file the page asked for, the page reloaded itself, at most once a minute. It didn’t help, because no file was missing. The old page loaded perfectly, then met data it didn’t understand.
The fix went in the same afternoon, in three parts:
- Build before restarting. The restart script now builds the web app right before it restarts the server, and if the build fails, it doesn’t restart. The page and the server go live together.
- Draw only what the page knows. Settings now skips any section it doesn’t recognise, so a newer server can’t crash an older page.
- A Reload note instead of a blank page. The whole app is wrapped in an error boundary. If drawing fails, it logs the error and shows “Something on this page didn’t load. Reload to get the latest version.” with a Reload button.
An error boundary catches errors while the page draws. It doesn’t catch errors in click handlers or in code that runs later1, so it’s the last guard, not the only one.
A smaller one: blank while it waited
On 22 November we fixed a page of ours that stayed blank for 12 seconds on machines whose browser draws 3D graphics in software. Its 3D background refuses to run on a software renderer, and the page waited for a 12-second check to give up before it showed its fallback background. Now it asks the browser first what it draws with, and shows the fallback straight away. A fallback that waits is still a blank page.
08Next time
Keep it from coming back
- Ship the page and the server together. Build first, and don’t restart or switch over if the build fails. On Vercel, turn on Skew Protection if your plan has it3.
- Serve index.html with Cache-Control: no-cache, and reload once when a file from an old deploy is gone, with Vite’s vite:preloadError event7.
- Wrap the app in an error boundary with a short note and a Reload button. In Next.js that’s an error.js file, and global-error.js for the root layout19. Send what it catches to error tracking; React’s componentDidCatch is the place for that1.
- Try the production build before it goes out. vite preview serves the built files on your own machine, so you see what visitors will see8.
- Load the live page after every deploy. Open the real address in a real browser, and treat an error in the console or a missing main heading as a failed deploy.
- Use error tracking that alerts a person, so you hear about a blank page from your tools, not your customers.
Those last two are most of what app monitoring means: we watch the live app, not the preview, and we know when it breaks before your customers tell you.
If your page is blank right now and none of this finds it, message us. Someone answers at any hour, gets it working first, then finds out why it broke.
Questions people ask
Why does my site show a blank white page after I deploy it?
Almost always because its JavaScript failed while starting, or the files it needs didn’t load. Open the developer tools with F12, read the first red error in the Console, then reload with the Network tab open and look for 404s on .js and .css files.
Why does my React app work locally but show a blank page in production?
The live build differs from your machine in a few known ways. Settings are written in when it’s built, and only VITE_ or NEXT_PUBLIC_ names reach the page. A site under a folder needs a base path. And the host may need a rewrite for addresses other than the home page. Run the production build locally with vite preview to see it as visitors will.
Why do some people see a blank page after a deploy and others don’t?
People who had the page open before the deploy are running the old code. If the host deleted the old files, or the new server sends data the old page doesn’t expect, only they break. Serve index.html with Cache-Control: no-cache, reload when an old file is gone, and ship the page and the server together.
Why does my app give a 404 when I refresh any page but the home page?
The host looks for a file at that address and finds none. A single-page app needs a rule that sends every address to index.html: /* /index.html 200 on Netlify, or a rewrite in vercel.json on Vercel. Cloudflare Pages does it by itself unless the project has a top-level 404.html.
How do I stop a blank page from happening again?
Build before you restart and stop if the build fails, wrap the app in an error boundary that shows a Reload note, load the live page after every deploy, and use error tracking that alerts a person.