A published site can be blank even when the editor preview works. That difference is useful: it points first to the production environment, built assets, or live routing—not to a random redesign.
30-second answer
Open the live URL, open browser developer tools, and reload once. Use the first red Console error and the first failed Network request to choose the branch:
- environment variable is missing or
undefined→ add it to the deployment host and redeploy - JavaScript or CSS returns 404 → fix the build output or public base path
Unexpected token <or a module MIME error → the URL returned HTML instead of JavaScript- only a nested URL fails after refresh → add the host’s documented SPA fallback
- JavaScript throws before the app mounts → fix that first runtime exception
Branch 1 — Production variables are missing
Secrets stored inside an app builder do not automatically exist on every external host. Compare the variable names in the project with the variables configured for the exact production environment. Do not copy secret values into chat or screenshots.
For a client-side Vite app, only variables intentionally exposed with the framework’s public prefix are available in browser code. Never expose a server key merely to make the blank screen disappear. Add or correct the variable in the deployment platform, then create a new deployment; changing a variable does not rewrite a build that already exists.
Branch 2 — Built assets are missing
In the Network panel, select a failed JavaScript or CSS request. A 404 usually means the deployed output and the generated asset URL disagree. Unexpected token < often means the script URL returned an HTML error page. A module MIME error can mean source files were uploaded instead of compiled output.
Run a clean production build locally:
npm run build
Deploy the directory your framework actually generates, such as dist/ for a standard Vite project. Follow the platform’s current build-output setting rather than guessing a folder name. If the app is served under a subpath, verify the framework’s public base path against that real URL.
Branch 3 — A nested route fails on refresh
If / works but /dashboard is blank or 404 after a direct visit, the browser router and the host disagree. Configure the hosting platform’s documented single-page-app fallback so application routes return index.html. Do not redirect asset files or API routes to index.html; that can produce the Unexpected token < error described above.
Test both a direct visit and a refresh on one nested route after the rewrite is deployed.
Branch 4 — The live app throws a runtime error
Start with the first exception, not every message below it. Typical examples include reading a property from undefined, initializing an API client without a required URL, or importing code that assumes a browser feature is available.
Give the agent the exact exception, file, and line number. Ask it to explain why that value is missing before editing. Fix one cause, rebuild, and retest the live URL in a private window.
Verify the fix
Use a new deployment and confirm:
- the deployment build completed successfully
- the live Console has no uncaught exception on first load
- JavaScript and CSS requests return successful responses with the expected content type
/and one nested route both work in a private window- the main interaction works, not just the first frame
A cached tab can show an old failure. Use a private window or hard reload for the final check.
If it still does not work
Restore the last deployment that worked, then compare its environment-variable names, build command, output directory, and routing rules with the failed deployment. If the provider reports an incident, stop changing code and wait. Otherwise send official support the deployment URL, first Console error, first failed Network request, and deployment log—after removing secrets and personal data.
Beginner summary
When the preview works but the published site is white, the live environment is different. Check the first red Console error, make sure the host has the required variables, deploy the compiled output, and test a nested URL. Change one branch at a time instead of asking the AI to rewrite the page.
