withastro/astro · warning
The @astrojs/netlify/functions import is deprecated and will
Error message
The @astrojs/netlify/functions import is deprecated and will be removed in a future release. Please use @astrojs/netlify instead.
What it means
The @astrojs/netlify/functions subpath export is a deprecated compatibility shim: importing it prints this console.warn and simply delegates to the default export of the main @astrojs/netlify entry, which now auto-detects the deployment target. It exists only so older configs keep working and will be removed in a future release.
Source
Thrown at packages/integrations/netlify/src/functions.ts:5
import type { AstroIntegration } from 'astro';
import netlifyIntegration, { type NetlifyIntegrationConfig } from './index.js';
export default function functionsIntegration(config: NetlifyIntegrationConfig): AstroIntegration {
console.warn(
'The @astrojs/netlify/functions import is deprecated and will be removed in a future release. Please use @astrojs/netlify instead.',
);
return netlifyIntegration(config);
}
View on GitHub (pinned to 52e6c34790)
Solutions
- Change the import to the package root: import netlify from '@astrojs/netlify'; and drop the /functions suffix.
- Remove the /functions path from TypeScript types/autoload too (the root export accepts the same NetlifyIntegrationConfig).
- Also migrate any @astrojs/netlify/static import to the root entry (same deprecation).
- Rebuild; the warning should no longer print during config load.
Example fix
// before
import netlify from '@astrojs/netlify/functions';
export default defineConfig({ adapter: netlify() });
// after
import netlify from '@astrojs/netlify';
export default defineConfig({ adapter: netlify() }); Defensive patterns
Strategy: validation
Validate before calling
// codemod check: fail CI if the deprecated subpath is still referenced
import { readFile } from 'node:fs/promises';
const cfg = await readFile('astro.config.mjs', 'utf8');
if (cfg.includes("'@astrojs/netlify/functions'")) {
throw new Error('Use the root @astrojs/netlify import, not /functions');
} Prevention
- Import only from '@astrojs/netlify'; treat subpath imports as removed code.
- Run a grep for '@astrojs/netlify/' after upgrading the adapter.
- Watch the adapter's CHANGELOG for removal of the shims before major upgrades.
When it happens
Trigger: astro.config.mjs contains import netlify from '@astrojs/netlify/functions' (the pre-v5 split entrypoint for server output). Loading the config executes the shim module and the console.warn fires once at import time.
Common situations: Upgrading a project from @astrojs/netlify v4 or earlier where /functions and /static subpath imports were the documented pattern; stale docs, examples, or templates referencing the old entries.
Related errors
- The @astrojs/netlify/static import is deprecated and will be
- The adapter ${adapter.name} uses `entrypointResolution: "exp
- Update your adapter to use `entrypointResolution: "auto"` or
- The adapter ${adapterName} has deprecated its support for "$
- [@astrojs/preact] Importing `getContainerRenderer` from `@as
AI-assisted analysis of withastro/astro@52e6c34790 (2026-08-18).
Data as JSON: /api/errors/6353a65a3b584528.
Report an issue: GitHub.