跳至正文
技术 SEO 与抓取索引 · Google SEO

JavaScript SEO for Vue and React: Diagnose Rendering and Indexing Problems

// / / 光算科技

Google can render JavaScript, so using Vue or React does not by itself make a website unindexable. Problems arise when a route cannot be fetched, important content or links do not survive rendering, or indexing signals conflict. Start by checking the actual response and rendered page before deciding whether the application needs architectural changes.

How Google processes a JavaScript page

Google describes three main stages: crawling, rendering and indexing. It fetches the initial response, extracts links, queues eligible pages for rendering and uses the rendered HTML in processing. The official JavaScript SEO guide explains that rendering availability can vary; it does not publish a universal 800-millisecond rendering budget or a fixed indexing-loss percentage for React and Vue.

A browser successfully displaying the homepage does not establish that every product or article route works for a fresh visitor. Test representative templates and error states, including direct navigation to deeper URLs.

Build a small route checklist before changing code

Route sampleWhat to verify
Public category or articleMain text, crawlable links and route-specific metadata
Individual productModel details, current data and availability without a prior session
Filtered or paginated viewWhether it needs a distinct indexable URL and how it is linked
Missing itemA genuine not-found response or appropriately handled error state
Private accountIntentional access controls rather than exposing private content for SEO

For each route, retain the URL, response status, initial HTML, rendered HTML, relevant errors and the expected content. A character-count difference can indicate JavaScript dependency, but it cannot determine whether an important answer is missing.

Diagnose the common failure paths

The direct URL fails while in-app navigation works

Check server routing and deployment configuration. A public route must work when opened directly, not only after clicking through the application. Use real <a href="…"> links and appropriate path-based routing; Google advises against URL fragments such as #/products for loading separate page content. Do not turn every invalid route into the same 200 homepage.

The initial HTML contains only a shell

Determine whether the required text appears after rendering and whether its scripts and API requests are accessible. Inspect missing chunks, failed responses, runtime exceptions and loading states. A shell is evidence of dependency, not proof that Google cannot index the page.

The page needs a previous visit or a click to show its answer

Google's JavaScript troubleshooting guide states that its rendering service does not retain cookies or local/session storage across page loads. Public content should not require a previous selection stored in the browser. Important information should also be available without expecting a crawler to fill a form or click a “load more” control.

Metadata changes into conflicting values

Check title, description, canonical and robots declarations in both the initial response and rendered HTML. Google can process JavaScript-generated metadata, but conflicting canonicals create uncertainty. An initial noindex can cause rendering to be skipped, so relying on JavaScript to remove it is unsuitable for a page intended to be indexed.

An old bundle or hydration error replaces correct content

Inspect whether the current HTML references available assets and whether server-produced markup agrees with the client's initial state. Use content-fingerprinted asset filenames and a deployment strategy that does not prematurely remove resources still referenced by cached pages. Diagnose the actual failing request or mismatch rather than assuming a fixed Google cache-refresh interval.

Choose rendering per page, not by a framework slogan

ApproachUseful whenAdditional work to plan
Static generation or prerenderingPublic content can be produced ahead of requestsRegeneration, freshness, route coverage and deployment size
Server-side renderingPublic responses need current or request-dependent informationServer latency, data access, caching and failure handling
Client-side renderingInteractive or private application behavior is centralReliable public content paths where search discovery matters
Hybrid rendering and hydrationReadable HTML and interactive components are both neededConsistent initial state, bundle cost and interaction testing

Next.js and Nuxt provide rendering options, but installing either does not prove every route is server-rendered. Confirm the actual output of the version and configuration you deploy. A public product description can be in the initial HTML while a personalized configurator remains interactive.

Google describes dynamic rendering for bots as a workaround rather than a recommended long-term solution. It adds separate rendering and maintenance paths. If a legacy implementation uses it, check content consistency and plan the appropriate long-term architecture instead of treating bot-specific output as an automatic ranking advantage.

A focused repair example

Suppose a product URL opens directly but stays on “Loading” because the API requires a cookie set by the homepage. The immediate investigation is the API access and route initialization, not an assumed React penalty. Make the intended public product data available to a fresh request, preserve legitimate private access controls, and consider producing the public description in the server response.

Then test an existing product, a missing product and a request with no stored browser state. Check that metadata and response codes follow those states. This is a diagnostic teaching example, not a claimed client recovery.

Verify the repair at the right level

Use the URL Inspection tool to distinguish Google's known indexed information from a current live test. Review rendered HTML, resources and exceptions when available. A local browser or crawler is useful for repeatable checks but does not reproduce Google's entire indexing process.

For a step-by-step evidence comparison, use the raw HTML, rendered DOM and Google-test workflow. After fixing the technical defect, verify performance and important interactions, then observe later crawling and indexing. Passing a render test is not a promise of indexing or rankings.