withastro/astro · warning

The @astrojs/netlify/static import is deprecated and will be

Error message

The @astrojs/netlify/static import is deprecated and will be removed in a future release. Please use @astrojs/netlify instead.

What it means

The @astrojs/netlify/static subpath export is a deprecated compatibility shim: importing it prints this console.warn and delegates to the root @astrojs/netlify entry, which detects static vs server output automatically. The shim will be removed in a future release; behavior is otherwise identical.

Source

Thrown at packages/integrations/netlify/src/static.ts:4

import netlifyIntegration from './index.js';

export default function staticIntegration() {
	console.warn(
		'The @astrojs/netlify/static import is deprecated and will be removed in a future release. Please use @astrojs/netlify instead.',
	);
	return netlifyIntegration();
}

View on GitHub (pinned to 52e6c34790)

Solutions

  1. Import from the package root instead: import netlify from '@astrojs/netlify'; and call netlify() with no arguments for static output.
  2. Migrate any @astrojs/netlify/functions import the same way.
  3. Rebuild and confirm the deprecation warning is gone during config load.

Example fix

// before
import netlify from '@astrojs/netlify/static';
export default defineConfig({ adapter: netlify() });

// after
import netlify from '@astrojs/netlify';
export default defineConfig({ adapter: netlify() });
Defensive patterns

Strategy: validation

Validate before calling

const cfg = await readFile('astro.config.mjs', 'utf8');
if (cfg.includes("'@astrojs/netlify/static'")) {
  throw new Error('Use the root @astrojs/netlify import, not /static');
}

Prevention

When it happens

Trigger: astro.config.mjs contains import netlify from '@astrojs/netlify/static' (the pre-v5 static-output entrypoint). The module is evaluated at config load, triggering the console.warn immediately.

Common situations: Projects upgraded from @astrojs/netlify v4.x where static sites were told to use the /static entry; older deployment templates and CI configs referencing the subpath.

Related errors


AI-assisted analysis of withastro/astro@52e6c34790 (2026-08-18). Data as JSON: /api/errors/34e5c911767b8e03. Report an issue: GitHub.