White screen in production, works in the editor

A blank page almost always means one error thrown before the first render. The trick is that the error is in the browser console, not in the deploy log, so people stare at a green deploy and a white page. Two minutes gets you the cause.

First: read the actual error

Open the site, press F12, look at the Console tab, and reload. The first red line is the cause; everything after it is noise.

How to checkIf the console is empty, open the Network tab and reload: a file returning 404 with a path that starts with a slash means the base path is wrong.
What to changeDo not guess before you read it. Every fix below depends on which of these you actually have.

On a phone, connect the device to the desktop browser's remote debugging. Do not debug mobile-only blank screens blind.

An environment variable is undefined, and the code reads a property of it

The most common single cause. A missing variable becomes undefined, the code immediately reads something off it, and the whole app dies before rendering.

How to checkThe console says something like cannot read properties of undefined.
What to changeAdd the variable to the host for both Production and Preview, with the right public prefix, and redeploy. Then make the code fail loudly instead: check for the value at startup and show a readable message.

This also happens when the variable exists but is empty, which is easy to miss in the host's settings UI.

The assets are requested from the wrong path

The app is built for a root domain and deployed into a subfolder, or the other way round. The HTML loads and every script 404s.

How to checkNetwork tab: files requested from a path that does not exist on your host.
What to changeSet the base path in the bundler config to match where the app actually lives, and rebuild.

This is the usual cause when a project works on the host's preview URL and breaks on your own domain.

The router has no fallback, so every direct link 404s

The home page works, but reloading any other page gives a blank or a 404. A single-page app needs the host to serve index.html for unknown paths.

How to checkOpen the home page, navigate inside the app, then press reload. If it breaks only on reload, this is it.
What to changeAdd a rewrite rule that sends all unmatched paths to index.html.

Shared links and ad campaigns land on inner pages, so this bug costs real customers while the home page looks fine.

The database is refusing every request and the app treats it as fatal

In production your keys and access rules are different from the editor. The first query throws, and nothing catches it.

How to checkConsole or Network shows 401, 403 or an empty result on the first data request.
What to changeSee the row-level security page below. Then wrap the first data call so a failure renders a message instead of a blank page.

An app that shows a white screen when the database is down will do it again at the worst moment. Add the fallback even after you fix the keys.

Not one of these five?

Send me the link and the exact error text. I will tell you what is broken and what it would take to fix, in writing, within 24 hours. That part is free, and you are not obliged to hire me afterwards.

If you do want it fixed: emergency rescue starts at $600, and I name one fixed number before I start.

Send me the link