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".
[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
- For SSR, set
output: "server"(or"hybrid") and add a matching adapter. - For a fully static site, keep
output: "static"and remove SSR-only APIs. - For mixed sites, use
"hybrid"and mark static pages withexport const prerender = true.
// 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.
export const prerender = true;How to prevent it
- Choose the output mode that matches your rendering needs.
- Install an adapter whenever using
serverorhybrid. - Avoid SSR-only APIs on pages meant to be static.