#adapters
1 messages · Page 1 of 1 (latest)
Hi @limber harbor. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Astro supports several official adapters, each designed to deploy your site to a specific environment or platform. Here’s a summary based on the knowledge sources:
What are the different adapters?
Astro maintains official adapters for:
- @astrojs/cloudflare (Cloudflare Workers)
- @astrojs/netlify (Netlify)
- @astrojs/node (Node.js servers, including standalone or as middleware)
- @astrojs/vercel (Vercel)
You can also find community adapters for other platforms in the integrations directory On-demand rendering.
Difference between Vercel and Node adapters
- @astrojs/vercel: Prepares your Astro project for deployment on Vercel, supporting on-demand rendering, server islands, actions, and sessions. It configures the build for Vercel’s serverless and edge environments, and is required if you want to use Vercel-specific features like their analytics or image optimization @astrojs/vercel.
- @astrojs/node: Prepares your project for deployment to a generic Node.js environment. It can run as a standalone server or as middleware for frameworks like Express or Fastify. This adapter is not tied to any specific hosting provider @astrojs/node.
In short: use the Vercel adapter for Vercel deployments, and the Node adapter for generic Node.js servers.
Why can you use Astro in dev mode without any adapter?
Astro’s development server does not require an adapter. Adapters are only needed for building and deploying your site for server-side rendering (SSR) or platform-specific features. In dev mode, Astro serves your site locally and does not need to know about your deployment target No adapter installed error.
Node is not the default adapter; you must explicitly add and configure an adapter for SSR or platform-specific builds.
Issues between local dev and production environments
- No Adapter in Dev: You can develop without an adapter, but if you try to use SSR features or deploy without configuring an adapter, you’ll get an error: “Cannot use server-rendered pages without an adapter” No adapter installed error.
- Platform Differences: The behavior of your site may differ between local dev (no adapter) and production (with an adapter), especially if you rely on SSR, server islands, or platform-specific features.
- Configuration: Each adapter may require specific configuration. Not configuring the adapter correctly can lead to deployment issues or missing features in production On-demand rendering.