Skip to content
Latchkey

Astro adapter / output mode mismatch (static vs server vs hybrid) in CI

Astro has three output modes: static, server, and hybrid. The mode must match your features and your adapter. Static output cannot use SSR APIs, and server/hybrid output requires an adapter. A mismatch fails the build in CI.

What this error means

The build errors that an adapter is required for output: "server", or that a dynamic/SSR feature cannot be used with output: "static".

astro
[config] `output: "server"` requires an adapter. Install one with:
  npx astro add node
or set output back to "static".

Common causes

Server/hybrid output without an adapter

The config sets output: "server" or "hybrid" but no adapter is configured, so no server entry can be built.

Static output using SSR-only features

A page uses Astro.request, sets response headers, or relies on runtime rendering while output: "static" prerenders everything.

How to fix it

Pick a consistent output mode and adapter

  1. For SSR, set output: "server" (or "hybrid") and add a matching adapter.
  2. For a fully static site, keep output: "static" and remove SSR-only APIs.
  3. For mixed sites, use "hybrid" and mark static pages with export const prerender = true.
astro.config.mjs
// astro.config.mjs
export default { output: "hybrid", adapter: node({ mode: "standalone" }) };

Mark prerendered pages in hybrid mode

In hybrid output, opt individual pages into static generation so the rest can render on demand.

src/pages/about.astro
export const prerender = true;

How to prevent it

  • Choose the output mode that matches your rendering needs.
  • Install an adapter whenever using server or hybrid.
  • Avoid SSR-only APIs on pages meant to be static.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →