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
- Import from the package root instead: import netlify from '@astrojs/netlify'; and call netlify() with no arguments for static output.
- Migrate any @astrojs/netlify/functions import the same way.
- 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
- Import the adapter only from '@astrojs/netlify'; it detects static vs server output itself.
- Grep for '@astrojs/netlify/' when upgrading from v4 to v5+.
- Keep deployment docs/templates pointing at the root entry.
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
- The @astrojs/netlify/functions import is deprecated and will
- The adapter ${adapter.name} does not support emitting a serv
- The adapter ${adapter.name} uses `entrypointResolution: "exp
- Update your adapter to use `entrypointResolution: "auto"` or
- The adapter ${adapterName} has deprecated its support for "$
AI-assisted analysis of withastro/astro@52e6c34790 (2026-08-18).
Data as JSON: /api/errors/34e5c911767b8e03.
Report an issue: GitHub.