SEO for single-page apps: why crawlers saw an empty page
Published 2026-11-06
The symptom
A React single-page application serves the same small HTML document for every URL: a head, an empty root element and a script. A browser runs the script and builds the page. A search crawler can do the same, but it does so later, in a queue, and with limited patience. Pages that depend entirely on that second step are often reported as discovered but not indexed, or are grouped under one canonical because they look identical to the crawler.
How to see what the crawler sees
Request the page with a crawler user agent and strip the scripts. If the remaining text is a few hundred characters, and the same on every route, that is what the first pass of indexing has to work with. Compare the byte size of several different routes: if they are nearly identical, the server is sending one shell for all of them.
Search Console shows the consequences as statuses: discovered but not indexed, crawled but not indexed, duplicate with a different canonical, or soft 404 for routes that return success but show an error message.
The fix: real content in the first response
The robust answer is to render the meaningful text on the server, for each public route, into the root element. React replaces it when it mounts, so users see no difference, while a crawler receives a complete page: a proper title and description, one heading, the actual paragraphs and navigation links to other pages.
Keep a single source of truth for that text, a data file the React components also import, so the server version and the client version cannot drift apart.
Housekeeping that matters just as much
- Give each page its own title, description and canonical URL.
- Return a real 404 status for unknown paths, or the crawler logs soft 404s.
- Mark pages that should not appear in search with noindex, and block clearly useless sections in robots.txt.
- List only indexable pages in the sitemap, with a last-modified date that reflects real change.
- Avoid hidden text and hidden links that are not meant for users; keep any visually hidden fallback consistent with what visitors see.
Patience
Even after a fix, indexing takes days to weeks. Request indexing for the most important URLs in Search Console, then watch the coverage report rather than resubmitting repeatedly.