What Causes This Error?
This error occurs when you use a client directive (client:load, client:visible, etc.) on a component whose renderer doesn’t provide a client-side entrypoint. This typically happens with server-only renderers or misconfigured integrations.
The Problem
---
import Component from '../components/Component';
---
<!-- ❌ Renderer doesn't support client-side hydration -->
<Component client:load />
The Fix
Use Supported Framework Integration
# Install official integrations that support hydration
npx astro add react
npx astro add vue
npx astro add svelte
// astro.config.mjs
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
export default defineConfig({
integrations: [react()],
});
Remove Client Directive for Static Components
---
import StaticComponent from '../components/Static.astro';
---
<!-- ✅ Astro components don't need client directives -->
<StaticComponent />
Common Scenarios
Astro Components Don’t Hydrate
---
// Astro components are server-only by default
import Header from '../components/Header.astro';
---
<!-- ❌ Can't hydrate .astro components -->
<Header client:load />
<!-- ✅ Just use without directive -->
<Header />
Using React for Interactivity
---
// For interactive components, use a framework
import Counter from '../components/Counter.jsx'; // React
---
<!-- ✅ React supports client hydration -->
<Counter client:load />
Custom Renderer Missing Client Entry
If you’re building a custom renderer:
// my-renderer/index.js
export default {
name: 'my-renderer',
// ❌ Missing clientEntrypoint
serverEntrypoint: './server.js',
};
// ✅ Add clientEntrypoint for hydration support
export default {
name: 'my-renderer',
serverEntrypoint: './server.js',
clientEntrypoint: './client.js', // Required for client: directives
};
Partial Hydration Alternative
---
// If you only need client-side logic, use a script
import Card from '../components/Card.astro';
---
<Card id="my-card" />
<script>
// ✅ Add interactivity via script
const card = document.getElementById('my-card');
card.addEventListener('click', () => {
console.log('Clicked!');
});
</script>
Islands Architecture
---
// Use framework components only where needed
import StaticHeader from '../components/Header.astro';
import InteractiveSearch from '../components/Search.jsx';
import StaticFooter from '../components/Footer.astro';
---
<StaticHeader />
<!-- Only this component hydrates -->
<InteractiveSearch client:load />
<StaticFooter />
Quick Checklist
- Use official framework integrations for hydration
- Astro components (
.astro) don’t support client directives - Remove
client:*from static components - Use framework components (React, Vue, Svelte) for interactivity
- Custom renderers need
clientEntrypointfor hydration