Skip to content
Latchkey

Astro "Cannot use `output: server` without an adapter" in CI

Astro can prerender to static HTML with no adapter, but server-rendered output needs a deployment adapter (Node, Vercel, Netlify, Cloudflare). Setting server output or prerender = false without one fails the build.

What this error means

astro build fails with "Cannot use output: \u0027server\u0027 or output: \u0027hybrid\u0027 without an adapter. Please install and configure the appropriate server adapter for your final deployment."

astro
[NoAdapterInstalled] Cannot use `output: 'server'` without an adapter.
Please install and configure the appropriate server adapter for your final deployment.
  Hint: https://docs.astro.build/en/guides/server-side-rendering/

Common causes

Server output without an adapter

The config sets output: 'server' (or a page sets prerender = false) but no adapter is added, so Astro has no target to build for.

The adapter is a devDependency missing in CI

The adapter is installed locally but not committed to package.json, so a clean npm ci never installs it.

How to fix it

Install and configure an adapter

  1. Add the adapter for your target with astro add.
  2. Confirm it appears in package.json and astro.config.mjs.
  3. Commit both so the clean CI install includes it.
Terminal
npx astro add node

Wire the adapter in config

Reference the adapter alongside server output.

astro.config.mjs
import node from '@astrojs/node';
export default defineConfig({
  output: 'server',
  adapter: node({ mode: 'standalone' }),
});

How to prevent it

  • Add the adapter as a real dependency, not just locally.
  • Use astro add so config and package are updated together.
  • Run npm ci then build in CI to catch missing adapters.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →