With Astro, check client:only first when important text or a link appears in the browser but is missing from the first HTML response: that directive skips server-side HTML rendering for the framework component. client:load, client:idle and client:visible control hydration timing instead. The component may already have HTML in the response. Compare one distinctive phrase and an important link before JavaScript with the DOM after the page loads, then inspect the directive on the actual framework element.
This check concerns one Astro component boundary, not every form of JavaScript SEO. It shows what the inspected build file or HTTP response contains. It proves neither Google's later rendering nor indexing. Astro's template directives reference describes the distinction. Google's JavaScript SEO basics separate crawling, rendering and indexing.
The short version: hydration is not rendering
An Astro framework component can already have HTML in the response before its JavaScript becomes interactive. Astro says framework components render to the page by default without client-side hydration. A client directive can control when the JavaScript loads and hydrates. For example, client:load loads the component JavaScript and hydrates the component when the page loads. Hydration connects JavaScript behavior to markup that is already present. It does not mean “Astro rendered no HTML at all.”
client:only draws a different boundary. Astro's documentation says it skips HTML server rendering and renders the component only on the client. That can suit a component that requires browser APIs while rendering. It also creates a testable dependency for any explanatory text, navigation link or product information that exists only inside that component.
| Astro setup | What to expect in the first HTML response | What happens next |
|---|---|---|
Framework component without client:* | Astro renders the markup when the selected integration supports server rendering | No client hydration is requested by a client directive |
client:load | Server-rendered markup is part of the response | JavaScript loads and hydrates on page load |
client:idle | Server-rendered markup is part of the response | Hydration starts after the initial load and when requestIdleCallback fires. If the browser does not support it, Astro uses the document load event. |
client:visible | Server-rendered markup is part of the response | Hydration starts when the component enters the visible area |
client:only | Astro skips server rendering for that framework component | The component loads and renders in the browser |
The table assumes that the selected framework integration and component can be server-rendered. It is not a guarantee that any component will emit the same text for every data state. Inspect the application you actually run.
Choose a useful test probe
Do not start with a random island or an arbitrary script. Choose a component whose content has a clear purpose on the URL: a product description, category overview, FAQ, comparison table or links to related pages. Then select one distinctive phrase and one specific link. “Product details” is not a very useful search string in a large response. A unique sentence or an exact expected href is easier to verify.
Record four things before testing:
- Which URL did you request?
- What HTTP status did the server return?
- Which exact text and internal link should be present?
- Which Astro component and directive produce that section?
This guards against a common shortcut in reasoning: a phrase is missing from the page source, so the whole page must not have rendered. You may have checked another route, an old build or a personalized version. The text may be intentionally behind an interaction. A different component may add it after JavaScript. Your probe should test one concrete hypothesis, not claim to prove an indexing failure.
Inspect the generated file for a static build
If Astro builds your route statically, inspect the actual HTML file in the build output. The development server is not a substitute. An adapter, middleware, data request or cache can make the build and live response differ. Search the file that corresponds to the route for your distinctive text and check the expected link. Reading the component source alone does not show what the build emitted.
A small, repeatable shell check might look like this:
bashrg -n 'The exact product sentence|href="/products/lamp"' dist/
Adjust the file path and search string to the route you are testing. A static output is not necessarily stored at dist/products/lamp/index.html; that depends on routing and slash configuration. First identify the file that supplies the URL. A match confirms that the phrase appears in the artifact you searched. It does not check redirects, headers, CDN behavior or the public endpoint's actual response.
For a server-rendered route, there may not be a finished HTML file for each route in the build directory. Inspect the running application's HTTP response instead. Use a production-like URL and a window when the content is stable. Note variants caused by language, login state, cookies or personalization. A local build can be useful, but do not present it as evidence of the public HTML response.
Capture the response and browser DOM separately
Compare two artifacts from the same URL. The first is the HTML response before browser JavaScript executes. The second is the DOM after the component loads. Search both for the same unique phrase and target link. Record the status, time and any redirect as well.
| Question | Response before JavaScript | DOM after page load |
|---|---|---|
| Is the distinctive product text present? | Yes / no | Yes / no |
Is the internal link present with the expected href? | Yes / no | Yes / no |
| What produces the section? | Astro file and directive | Observe hydration or browser rendering |
| Which response did you inspect? | Status, URL, build or live response | Browser, viewport, wait and interaction |
A useful observation might read: “The product paragraph is visible in the browser DOM but absent from the HTTP response. The Astro component uses client:only.” That is a technical diagnosis. “Google cannot read the page” is not supported by that comparison alone.
Do not use the DevTools Elements panel as your response capture. It shows the live DOM, which may already have changed. Inspect the document response in the Network panel or, for a static page, the file supplied by the build. Then compare it with the same browser session after JavaScript runs. Confirm that both observations refer to the same URL and content.
A realistic product explanation example
Imagine a category page with an interactive product adviser. A React component calculates a recommendation from user input. Three paragraphs beside it explain the product categories to people arriving from search. If the entire section lives inside a client:only component, those paragraphs appear only after the browser successfully executes the component JavaScript.
The first step is not to remove client:only everywhere. Open the component and find out why it is browser-only. Does its initialization read window while rendering? Is only the choice interface interactive, while the explanation does not depend on it? Or does the text truly depend on a user input?
If the content is independent of browser state or interaction, it may make sense to render it as Astro markup outside the client-only component. The interactive choice can remain a separate component. If the entire component needs a browser, consider whether a useful, persistent explanation can sit outside the island. Astro documents that a fallback slot can appear while a client:only component loads. It is a loading state that disappears when the client component is ready. A short “Loading…” message does not supply the product explanation or its internal links.
This is a page-content decision. The server response can carry material that has meaning even when no interaction has occurred. The client component can provide the additional interaction. This is not a blanket ban on client:only. A calculator, editor or personalized tool may be a suitable case. The question is whether this specific content needs to be available before browser rendering.
Check the directive where it is applied
Large Astro projects can have several component layers. Find the .astro template that directly imports the framework component and inspect the attribute on that component tag. Astro notes that client directives can only be applied to certain directly imported UI framework components. A directive on the wrong element or a dynamically passed tag may not explain the output you see.
Also check whether the text is really inside the framework component. It may come from an Astro template, layout, content collection or another nested component. If the paragraph is already outside the island as a <p>, a nearby client:only control cannot explain why that paragraph is missing.
For a reused component, compare two routes that include the same component and directive. If the output is correct on one route but not another, a different data source, conditional template branch or page component may explain the difference. Not every rendering discrepancy is a hydration problem.
Google can render JavaScript, but that is not a free pass
Google Search describes separate phases for crawling, rendering and indexing. Eligible pages can be queued for rendering, and the rendered HTML can be used for indexing. Rendering is not necessarily part of the same immediate fetch. Google also describes constraints, including cases where the page or a required resource is blocked by robots.txt. Other search engines, social preview bots and specialist crawlers can have different capabilities.
Server-rendered content helps you understand what the page depends on. It gives systems that process HTML directly a usable response and makes technical inspection simpler. But it does not guarantee indexing, and it does not prove Google will never render later JavaScript. Missing text in the first HTML does not by itself prove Google will never see it.
The crawling glossary entry and the meaning of noindex describe different diagnostic steps. A Google render is not the same thing as indexing. Use the available Search Console tools if you need to inspect Google's rendering of a particular URL. A screenshot or rendered HTML from a live test is an observation of that URL at that time, not a promise about a later indexing decision.
A five-step technical check
This sequence keeps build, response and browser state separate:
- Choose a real URL with relevant content, plus one distinctive sentence and link.
- Record the document response status and final URL.
- For a static route, inspect the corresponding build file. For SSR, inspect the running HTTP response.
- Compare the text and
hrefwith the browser DOM after JavaScript finishes. - Match the difference to the specific Astro component and directive before changing code.
If the component uses client:only and the text is missing from the response, you have a clear technical relationship to investigate. Next comes a design decision: does that text need to be present independently of an interaction? If it does, move or render that part on the server, then repeat the same check. If it does not, record why client-side rendering is acceptable for that content and which systems still need to process it.
Then check other properties separately. A missing internal link is not the same problem as a long script download. Product text missing from the first HTML is not automatically a noindex issue, and a Core Web Vitals report does not replace the response comparison. The JavaScript rendering glossary entry puts the finding into a wider technical SEO context.
Write down the evidence
A useful task includes the URL, status, component, directive, missing phrase or link, and the two artifacts you compared. For example:
| Field | Example value |
|---|---|
| URL | https://example.com/guides/lamp |
| HTTP response | 200, unchanged final URL |
| Probe | Sentence “This lamp suits rooms up to 20 m²” and link /products/lamp |
| First response | Paragraph and link are absent |
| Browser DOM | Both appear after the component renders |
| Astro setup | ProductGuide client:only="react" |
| Next change | Check whether the description can be moved outside the island |
| Not established | Google indexing, ranking impact or other bots' behavior |
This example is fictional. It does not describe a customer site or an audit that was run. For a real ticket, record a build hash or release time so that the file and HTTP response are not from different versions.
The mobile-first indexing glossary entry covers a different check. If a page serves different content on mobile and desktop, inspect each presentation. That is not automatically a client:only issue. Page speed helps with a separate loading question, but a performance value does not tell you whether the target text appears in the first HTML.
The Site Audit for technical SEO can put an individual response finding into a wider URL review. A crawler can inspect status, links and accessible content. That alone does not establish how a framework component looks after JavaScript runs. Record the render mode and add a browser or Google render check when needed. Our guide to Soft 404s in JavaScript stores covers a separate response-status problem. The published guide to canonicals changed by JavaScript covers a different element in the page head, not Astro island content.
To turn a concrete discrepancy into an actionable task, see the guide to prioritizing Site Audit findings. Keep the observed response difference separate from Search Console evidence and later search results.
Judge the affected component, not the whole page
If an Astro page looks complete in the browser but important text or a link is missing from the initial HTML, look for client:only on the component that produces that section. Compare the response or corresponding build file with the DOM after JavaScript runs. Other client:* directives control hydration and should not be treated as “no server HTML” by default.
That turns a vague concern into a testable statement about one URL and one component. Claims about Google, indexing or rankings need separate evidence.