Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Web app blank page: how to fix a JavaScript bundle failure

OPS-021High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Many modern sites and apps (React, Vue, Angular, Next.js, single-page landing pages) send almost empty HTML and rely on a JavaScript bundle to draw the page. A bundle is one or more compiled script files, such as main.3f9a1c.js. If that file fails to load or crashes, the visitor sees a blank white page. The server still answers with status 200, so a basic uptime check says everything is fine.

Why it costs you leads or sales

A blank page has no form, no button and no checkout. Every visitor who lands on it, including those from paid ads, leaves at once. You still pay for the click, and your analytics may record nothing because the tags never ran. It can also hit only some visitors (one browser, one region, cached HTML), so it is easy to miss.

Where a bundle failure breaks the funnel
  1. Ad clickVisitor arrives
  2. HTML loadsStatus 200, empty shell
  3. JS bundle404, blocked or crashes
  4. Form or checkoutNever rendered
  5. Lead or saleNot created

The server answers fine, but the script never draws the page.

Leads before and after a bad deployExample numbers
Leads before and after a bad deploy (example)Before deploy: 24 leads per day; Day of failure: 3 leads per day; After fix: 23 leads per day091824323Before deployDay of failureAfter fixleads per day

Example: illustrative numbers for a page that goes blank after a deploy while ad spend stays the same.

How to check if your site has it

Find the failing bundle
  1. Open the page in a private window

    This avoids extensions and cached files. Try Chrome and one other browser, and a phone if you can.

  2. Open DevTools Console

    Press F12 (or Cmd+Option+I on Mac) and open Console. Reload. Look for red errors such as ChunkLoadError, Failed to load resource: 404, Uncaught SyntaxError: Unexpected token '<', or Refused to load the script (a content security policy block).

  3. Check the Network tab

    Filter by JS. Click the failing file and look at the status, the Content-Type and the response. If the response is HTML instead of JavaScript, the path is wrong or the server returned an error page.

  4. Check View Source

    Compare the script file names in the HTML with files that exist on the server or CDN. A mismatch means stale HTML or an incomplete deploy.

  5. Test from another network or region

    Some failures only affect one CDN edge or one cached copy.

What common console errors usually mean
Console messageLikely cause
Unexpected token '<'Script URL returns an HTML page (404 or redirect) instead of JavaScript
ChunkLoadError / Loading chunk failedOld hashed file deleted after a deploy, or CDN not updated
Refused to load the scriptContent Security Policy blocks the script source
MIME type ('text/html') is not executableWrong path or server sends wrong Content-Type
Uncaught TypeError / ReferenceErrorRuntime error in app code or a missing environment variable
A page that loads but shows nothing

The HTML arrives, the script fails and the visitor sees a white page.

How to fix it

Fix the cause the console points to. The steps below cover the most common ones. Then use the platform tabs if your site is built with a site builder.

Fix the bundle failure
  1. Correct the script path

    Make sure the base URL or publicPath matches where files are served (for example /assets/ or your CDN domain). Rebuild and redeploy.

  2. Keep old files after a deploy

    Do not delete previous hashed bundles immediately. Keep them for a while so visitors with cached HTML can still load them.

  3. Purge the CDN and page cache

    Clear the cache so HTML and bundles match. Set HTML to a short cache time and hashed assets to a long one.

  4. Fix the Content-Type and redirects

    Scripts must be served as application/javascript (or text/javascript). Make sure rewrite rules do not send missing .js files to index.html.

  5. Adjust the Content Security Policy

    If the console says a script was refused, add the exact source to script-src. Do not use a wildcard to silence it.

  6. Fix the runtime error

    If the file loads but crashes, read the stack trace, fix the code or the missing environment variable, and roll back the last deploy if you need time.

Fix by platform
  1. Clear all caches

    Purge your caching plugin, server cache and CDN. Then reload in a private window.

  2. Disable minify and combine JS

    In your optimisation plugin (for example WP Rocket, Autoptimize, LiteSpeed Cache), turn off JS minify, combine and delay options, then retest. Re-enable one at a time.

  3. Check for a plugin or theme conflict

    Deactivate plugins one by one, or switch to a default theme on a staging copy, until the error goes away.

Nginx: cache HTML briefly, hashed assets for long, no fallback for missing JSnginx
location /assets/ {
  try_files $uri =404;
  add_header Cache-Control "public, max-age=31536000, immutable";
}

location / {
  try_files $uri /index.html;
  add_header Cache-Control "no-cache";
}

How to confirm it's fixed

Confirmation checks
  • The page renders in a private window with the console showing no red errors
  • Every JS file in the Network tab returns 200 with a JavaScript Content-Type
  • It works after a hard reload (Ctrl+Shift+R) and on mobile
  • The form or checkout appears and a test submission works
  • Analytics and ad tags fire again (check in the Network tab or tag preview)
  • The page works from a second region or network

How to prevent it happening again

Prevention habits
  • Test the live page in a clean browser after every deploy, not just staging
  • Keep previous hashed bundles available for a while after releases
  • Cache HTML briefly and hashed assets for a long time
  • Purge the CDN as part of the deploy process
  • Add error reporting for uncaught JavaScript errors
  • Review script changes in tag managers and builders before publishing
  • Monitor the real page with a browser-based check, not only a status-code ping
How an unnoticed bundle failure unfolds
  1. Example: 10:00

    A new version is deployed and old bundle files are removed.

  2. Example: 10:05

    Visitors with cached HTML request a deleted file and see a blank page.

  3. Example: 10:05 to 16:00

    Uptime checks still report 200 OK. Ad clicks keep arriving.

  4. Example: 16:00

    Someone notices the drop in leads and starts investigating.

  5. Example: 16:30

    Cache purged and files restored. Page renders again.

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor loads your page in a real browser on a schedule and records console errors, such as a failed script or an uncaught exception. It also asserts that the page actually shows what it should, for example the form, button or heading for that step, so a blank page fails the check even when the server returns 200.

Questions people ask

Why is my web app showing a blank white page?

Most often the JavaScript bundle that draws the page failed to load or crashed. Open the browser console and Network tab, find the red error or the failing file, and fix the path, cache or code it points to.

What does 'Unexpected token <' mean in my JavaScript bundle?

It means the browser asked for a script but received HTML, usually an error page or index.html. The script path is wrong, the file was deleted, or a rewrite rule returns the HTML shell for missing files.

Why does the blank page only happen after a deploy?

Hashed bundle names change with every build. If old files are deleted while visitors or a CDN still hold the old HTML, they request files that no longer exist. Keep old bundles for a while and purge caches.

Why does my uptime monitor say the site is up when the page is blank?

A basic uptime check only looks at the HTTP status, and the server still returns 200 for the empty HTML shell. You need a browser-based check that loads the page, reads console errors and confirms expected content is visible.

How do I fix ChunkLoadError?

A ChunkLoadError means a lazy-loaded file could not be fetched. Redeploy the full build, keep old hashed files, purge the CDN and check the public path. Adding a retry or a page reload on chunk errors helps visitors with stale tabs.

Can a tag manager script cause a blank page?

Yes. A Custom HTML tag with a syntax error or a script that rewrites the page can break rendering. Use Tag Assistant preview to find it, then roll back to the previous container version.

Can FunnelGuard tell me when my page goes blank?

Yes. It loads the page in a real browser on a schedule, records console errors and checks that expected elements appear. If a check fails twice, it sends one alert with a screenshot and a likely cause.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: Console errors + asserts.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.