withastro/astro · error · Error

The adapter ${adapter.name} doesn't provide a feature map. I

Error message

The adapter ${adapter.name} doesn't provide a feature map. It is required in Astro 4.0.

What it means

When an adapter is set via `setAdapter` in `astro:config:done`, Astro requires `adapter.supportedAstroFeatures` to be present (introduced as mandatory in Astro 4.0). If the adapter object omits `supportedAstroFeatures`, Astro throws a plain Error so adapters explicitly declare the feature set they support.

Source

Thrown at packages/astro/src/integrations/hooks.ts:398

	logger: AstroLogger;
	command?: 'dev' | 'build' | 'preview' | 'sync';
}) {
	for (const integration of settings.config.integrations) {
		await runHookInternal({
			integration,
			hookName: 'astro:config:done',
			logger,
			params: () => ({
				config: settings.config,
				setAdapter(adapter) {
					validateSetAdapter(logger, settings, adapter, integration.name, command);

					if (adapter.adapterFeatures?.buildOutput !== 'static') {
						settings.buildOutput = 'server';
					}

					if (!adapter.supportedAstroFeatures) {
						throw new Error(
							`The adapter ${adapter.name} doesn't provide a feature map. It is required in Astro 4.0.`,
						);
					} else {
						validateSupportedFeatures(
							adapter.name,
							adapter.supportedAstroFeatures,
							settings,
							logger,
						);
					}
					settings.adapter = adapter;
				},
				injectTypes(injectedType) {
					const normalizedFilename = normalizeInjectedTypeFilename(
						injectedType.filename,
						integration.name,
					);

View on GitHub (pinned to d081033d5f)

Solutions

  1. Upgrade the adapter package to a version compatible with Astro 4.0+ that declares `supportedAstroFeatures`.
  2. If authoring an adapter, add `supportedAstroFeatures: new Set([...])` listing supported `Serveronly`/feature flags (can be an empty set if none).
  3. Switch to a maintained adapter if the current one is abandoned.

Example fix

// before
export default function myAdapter() {
  return {
    name: 'my-adapter',
    serverEntrypoint: '@my/adapter/server.js',
    hooks: { 'astro:config:done': ({ setAdapter }) => setAdapter({ name: 'my-adapter', serverEntrypoint: '@my/adapter/server.js' }) },
  }
}

// after — declare the feature map (Astro 4.0+)
setAdapter({
  name: 'my-adapter',
  serverEntrypoint: '@my/adapter/server.js',
  supportedAstroFeatures: new Set([
    AstroAdapterFeature.AstroNodePlatformSupportPackageDeprecated,
  ]),
})
Defensive patterns

Strategy: validation

Validate before calling

function assertAdapterHasFeatures(adapter) {
  if (!adapter || !adapter.supportedAstroFeatures) {
    throw new Error(`Adapter ${adapter?.name} must declare supportedAstroFeatures (Astro 4.0+)`);
  }
}

Type guard

function adapterDeclaresFeatures(adapter) {
  return !!adapter && adapter.supportedAstroFeatures instanceof Set;
}

Try / catch

null

Prevention

When it happens

Trigger: An adapter object passed to `setAdapter` has no `supportedAstroFeatures` property (e.g. `setAdapter({ name, serverEntrypoint })` with no feature map).

Common situations: Using an adapter built for Astro 3.x that predates the required feature map; authoring a custom adapter and omitting the field; an adapter that sets `supportedAstroFeatures: undefined` explicitly.

Related errors


AI-assisted analysis of withastro/astro@d081033d5f (2026-08-12). Data as JSON: /api/errors/32aa95cdd4a53215. Report an issue: GitHub.