No Facebook preview for a single-page app
A client-rendered app (React, Vue, Svelte, Angular) sends every visitor the same index.html and fills in the <head> with JavaScript. Facebook's crawler identifies itself as facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php) and does not run that JavaScript, so it only ever sees the shell's default tags, or none.
Diagnosis
Why it happens on Facebook
- Every route shares one HTML file, so Facebook shows the same title and image for every page, or no card at all.
- Helmet-style head managers and document.title changes happen in the browser, after Facebook has already read the response.
- The request can be detected by the "facebookexternalhit" token in its User-Agent, which is what an edge snippet keys on.
- Facebook shows a 1200×630 px image and about 95 characters of title, so the snapshot needs real per-route values, not the app name.
- Among social networks, Threads share Facebook's facebookexternalhit crawler, so the same fix applies there.
Scanner checks: og-title-present, og-image-present, og-url-matches
The fix
Fix it step by step
- Scan a deep link of your app: if the scanner sees the shell's tags, so does Facebook.
- Best fix: render the og:* tags on the server (SSR, static export or prerendering per route).
- Otherwise add an edge rule that serves a pre-rendered HTML snapshot when the User-Agent contains "facebookexternalhit"; the meta tag generator has ready snippets for Cloudflare Workers, Next.js middleware and Vercel.
- Re-scan the same deep link and confirm the route's own title and image come back.
<title>Your page title</title>
<meta name="description" content="A one or two sentence summary of this page.">
<meta property="og:title" content="Your page title">
<meta property="og:description" content="A one or two sentence summary of this page.">
<meta property="og:image" content="https://example.com/og.png">
<meta property="og:url" content="https://example.com/page">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Your site name">
<meta name="twitter:card" content="summary_large_image">Facebook cache: Facebook keeps the first scrape of a URL. Open the Sharing Debugger (developers.facebook.com/tools/debug), paste the exact URL and click Scrape Again; posts already published may keep the card they were created with.
Check your link on Facebook
FAQ
Common questions
Does Facebook's crawler run JavaScript?
No. It reads the HTML your server returns to facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php). Tags inserted by client-side JavaScript are not seen.
How do I detect Facebook's crawler at the edge?
Match "facebookexternalhit" in the lowercased User-Agent and serve a snapshot whose <head> holds the route's og:* tags. Humans keep getting the normal app.