434 words
2 minutes
[Astro] How to Fix NoAdapterInstalled Error - SSG Build Troubleshooting

How to Fix the “NoAdapterInstalled” Error in Astro Builds#

Astro Build Error

Have you ever suddenly encountered a NoAdapterInstalled error when trying to build your Astro project? Many people are particularly troubled by cases where “I want to build with static site generation (SSG), but I’m told server-side rendering (SSR) is required.” I hope I’m not the only one.

While this error seems like a small problem at first glance, it can take time to resolve. In this article, I’ll introduce 5 main causes and solutions for the NoAdapterInstalled error that I’ve actually experienced, in checklist format.

Cause 1: astro.config.* Configuration Error - Checking output Value#

When using only SSG, always set:

export default defineConfig({
  output: 'static',
});

I can hear voices saying “I’m already doing that,” but please be careful with:

export default defineConfig({
  output: 'hybrid',
});

or

export default defineConfig({
  output: 'server',
});

Cause 2: Incorrect Use of prerender = false Setting#

This is a trap. Do you have this line somewhere?

export const prerender = false;

This single line makes that page a target for dynamic generation. Its impact affects the build. How scary.

Cause 3: Missing getStaticPaths() Method in Dynamic Routes#

This is criminal. Having a hierarchy like [...blog] without preparing for it is deliberate.

Cause 4: API Endpoint SSG Incompatibility Issues#

Do you have something like src/pages/api? Give up, I think that’s impossible with SSG.

Cause 5: Unnecessary Server Adapter Configuration#

Did you accidentally install & use @astrojs/netlify/functions or @astrojs/vercel/serverless?

import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';

export default defineConfig({
  output: 'server',
  adapter: vercel(),
});

If you have something like this, please remove it.

Real Experience: My Solution to the NoAdapterInstalled Error#

In my case, Cause 2 was the problem. I had forgotten to revert a prerender = false setting that I had added for testing purposes. As a result, even though I had specified output: 'static' in astro.config.mjs, it was being overridden by the page-level setting.

The important lesson I learned from this experience is that Astro settings are applied hierarchically. Since global settings (astro.config.*) can be overridden by page-level settings, when build errors occur, always check page-level settings as well.

Summary: NoAdapterInstalled Error Resolution Checklist#

When a NoAdapterInstalled error occurs in your Astro project, try checking the following 5 points in order:

  1. Check that the output setting in astro.config. file* is set to 'static'
  2. Check that no prerender = false setting has crept in at the page level
  3. Check that getStaticPaths() is implemented for dynamic routing pages
  4. Check that API endpoints are compatible with SSG mode
  5. Check that no server adapter is mistakenly configured

By checking these points in order, you should be able to identify and resolve the problem in most cases.

Reference Resources#

[Astro] How to Fix NoAdapterInstalled Error - SSG Build Troubleshooting
https://naonao-na.com/en/posts/astro-noadapter-error/
Author
[object Object]
Published at
2025-05-09