Skip to main content

Vite React SEO: Fix What Crawlers Cannot Read

Vite React SEO guide for developers: see what Google and AI crawlers get from your SPA, then fix pre-rendering, titles, and links step by step.

By Kaivalya Deshpande, Founder, RankBrain AI·Published ·5 min read

Vite React SEO requires fixes at the HTML level because a Vite build ships a single index.html with an empty root element and JavaScript bundles. Crawlers that fetch HTML without running JavaScript receive almost no content. Google crawls first and renders JavaScript in a separate later step. This page covers every fix a Vite React SPA needs, in order. If your site came from Lovable before 13 May 2026 or from Bolt.new, it is a Vite React app. See Lovable SEO fix and Bolt.new SEO for platform steps.

Is React Vite SEO friendly

A Vite React app outputs a single index.html for all routes. The body contains one root div and a script tag. That is what a crawler receives before JavaScript runs. Google crawls the raw HTML first, then queues a separate rendering pass that runs JavaScript. Rendering happens in a separate step after Google crawls the page. Many AI crawlers fetch HTML without running JavaScript. Those crawlers see a page with no title, no visible text, and no meta description. Rankings are not guaranteed by any tool, but a page with no readable content has no path to ranking.

Check What Your Site Sends Crawlers

  • Open the view page source tool, enter your live URL, and read the HTML. A body with only a root div means crawlers see an empty page.
  • Run the AI crawler checker to confirm GPTBot and ClaudeBot are allowed in your robots.txt.
  • Search Google for an exact sentence from your page with site:yourdomain.com to see whether Google has that text indexed.

React SPA SEO: Fixes in Order

These seven fixes cover the main gaps in a Vite React SPA. Apply them in order.

Vite React SEO fixes in priority order
FixHow to checkWhat to change
Pre-render each public route at build timeView source on /about or /pricing. Real body text should appear in the HTML.Add a pre-render plugin such as vite-react-ssg. Each route gets its own static HTML file at build time.
Unique title and meta description per routeView source on two pages and compare the title tags in the head. Both should differ.Use React 19 built-in title and meta tags inside each route component, or add react-helmet-async for earlier versions.
Real paths instead of hash URLsCheck whether any URL contains /#/. Hash URLs count as one URL for search engines.Switch your router to browser history mode. Configure your host to serve index.html for all paths.
sitemap.xml and robots.txt in the public folderOpen yourdomain.com/sitemap.xml and yourdomain.com/robots.txt in a browser. Both should load.Use the sitemap generator and robots.txt generator. Add a Sitemap line to robots.txt pointing to your sitemap URL.
Real anchor links with href for navigationView source and check the main navigation. Each link should be an anchor element with an href attribute.Replace button-based navigation with anchor elements. Buttons that navigate with JavaScript give crawlers no link to follow.
JSON-LD on key pagesView source and search for application/ld+json in the head.Add Organization schema to your home page. Use the schema markup generator to build and validate the JSON-LD.
Real 404 status for unknown URLsOpen a URL that does not exist on your site. Check the HTTP status in browser dev tools under Network.Configure your host to return a 404 status for unknown paths.

Vite React SEO plugin Options by Job

Pick tools by what job they do.

  • Pre-render or static generation: vite-react-ssg generates a static HTML file for each route at build time. vite-plugin-ssr supports both static generation and server rendering per route.
  • Head management: React 19 renders title and meta tags inside components and hoists them into the document head. For earlier versions of React, react-helmet-async manages the document head per route.
  • Sitemap: A Vite sitemap plugin generates sitemap.xml from your route list at build time.
  • Server rendering as a larger option: Moving public pages to a framework such as Next.js, React Router in framework mode, or TanStack Start adds server rendering, head management, and clean routing in one step. Lovable apps built from 13 May 2026 run TanStack Start with server rendering (Lovable documentation, read 19 November 2026). Older Lovable and Bolt.new apps are Vite React and need the fixes above.

React SEO without SSR

Pre-rendering at build time writes HTML for each route whose URL is fixed when the build runs. Routes with static paths, such as /about or /pricing, pre-render cleanly and give crawlers real content. Routes that depend on live data per request, such as a user profile page or a page fetching current prices from an API, cannot be pre-rendered at build time. The content for those routes is unknown until a request arrives. Those pages need server rendering to give crawlers current content. See server-side vs client-side rendering for SEO for a full comparison.

Apply These Fixes with RankBrain AI

RankBrain AI is an SEO MCP server. It connects to the AI coding tool you already use: Claude Code, Cursor, Codex, Windsurf, Cline, and others.

  1. Sign up at rankbrain.app and open the dashboard.
  2. Pick the tab for your coding tool, copy the setup prompt (your API key is already in it), and paste it into a new chat in your project. The AI writes the MCP config and AGENTS.md rule file.
  3. Restart the tool and confirm the server maitreya-labs-seo-mcp is connected.

After setup, run a prompt such as: "Audit the SEO of https://example.com and list the fixes." RankBrain AI reads the live site and shows the current content and the exact replacement side by side. Each fix waits for your approval before it is written to a project file. git diff shows each change. git revert undoes it. The site looks identical to visitors. Only search engines and AI assistants see the difference. Price: free for 3 days, then $5 a month, cancel anytime.

Check my site free to see what Google and AI crawlers currently read on your site.

Frequently asked questions

Does pre-rendering break React interactivity?

Pre-rendering writes static HTML at build time. React hydrates the page in the browser and all interactive features work as before.

Can I add SEO to a Lovable or Bolt.new app?

Bolt.new apps are Vite React apps and use the fixes on this page. Lovable apps built before 13 May 2026 are also Vite React. See Lovable SEO fix and Bolt.new SEO for platform details.

Do AI Overviews use different SEO rules than regular Google search?

Google states the same SEO best practices apply to AI Overviews and AI Mode, with no extra requirements, as described in Google's guide to AI features. Readable HTML and accurate structured data are the starting point for both.

What happens to hash URLs in a React SPA?

Hash URLs such as /#/pricing are treated as one URL by search engines. The hash fragment is not sent to the server and search engines do not index it separately. Switch your router to browser history mode to fix this.

React Router Link components render as anchor tags. Are they crawlable?

React Router Link components render anchor elements with href attributes, and crawlers can follow them. The problem arises with custom navigation that uses button elements and JavaScript click handlers. Those give crawlers no link to follow.

Where can I read more about SEO for AI-generated sites?

See SEO for vibe-coded sites for a broader look at SEO for Lovable, Bolt.new, and other AI-built apps, or Replit SEO for Replit-specific steps.

Keep reading

Vite React SEO requires fixes at the HTML level because a Vite build ships a single index.html with an empty root element and JavaScript bundles. Crawlers that fetch HTML without running JavaScript r…

This site is not a part of the Facebook website or Meta Platforms, Inc. Additionally, this site is not endorsed by Meta in any way. Facebook and Instagram are trademarks of Meta Platforms, Inc. This site is also not a part of Google LLC and is not endorsed by Google in any way. Google and YouTube are trademarks of Google LLC. Maitreya Labs runs this site and its offers on its own.