withastro/astro · warning

[@astrojs/vue] Importing `getContainerRenderer` from `@astro

Error message

[@astrojs/vue] Importing `getContainerRenderer` from `@astrojs/vue` is deprecated. Import it from `@astrojs/vue/container-renderer` instead.

What it means

@astrojs/vue exports a deprecated `getContainerRenderer()` from its package root (packages/integrations/vue/src/index.ts:32). Calling it logs this console.warn and then delegates to the real implementation from `@astrojs/vue/container-renderer`. It exists only for backwards compatibility: container rendering (MDX-style entrypoints used by Astro Container API / experimental static extraction) moved to a separate subpath export to keep the main entry lean. Functionally nothing breaks — you get the same renderer object — but the root export may be removed in a future major, and importing it also pulls the full Vue plugin entry into the container process.

Source

Thrown at packages/integrations/vue/src/index.ts:32

interface Options extends VueOptions {
	jsx?: boolean | VueJsxOptions;
	appEntrypoint?: string;
	devtools?: boolean | Omit<VitePluginVueDevToolsOptions, 'appendTo'>;
}

function getJsxRenderer(): AstroRenderer {
	return {
		name: '@astrojs/vue (jsx)',
		clientEntrypoint: '@astrojs/vue/client.js',
		serverEntrypoint: '@astrojs/vue/server.js',
	};
}

/**
 * @deprecated Import `getContainerRenderer` from `@astrojs/vue/container-renderer` instead.
 */
export function getContainerRenderer(): AstroRenderer {
	console.warn(
		'[@astrojs/vue] Importing `getContainerRenderer` from `@astrojs/vue` is deprecated. Import it from `@astrojs/vue/container-renderer` instead.',
	);
	return getContainerRendererImpl();
}

function virtualAppEntrypoint(options?: Options): Plugin {
	let isBuild: boolean;
	let root: string;
	let appEntrypoint: string | undefined;

	return {
		name: VIRTUAL_MODULE_ID,
		config(_, { command }) {
			isBuild = command === 'build';
		},
		configResolved(config) {
			root = config.root;
			if (options?.appEntrypoint) {

View on GitHub (pinned to 52e6c34790)

Solutions

  1. Change the import specifier from '@astrojs/vue' to '@astrojs/vue/container-renderer' — everything else (name, signature, return) is identical.
  2. Search the repo for `from '@astrojs/vue'` and fix any occurrence that imports `getContainerRenderer` specifically (other exports like the default `vue()` plugin still come from the root).
  3. If a third-party integration/starter triggers it, update that dependency to a release importing from the subpath, or patch via package overrides.

Example fix

// before
import { getContainerRenderer } from '@astrojs/vue';

// after
import { getContainerRenderer } from '@astrojs/vue/container-renderer';
Defensive patterns

Strategy: validation

Validate before calling

// ESLint: fail any deprecated root-level container renderer import
// eslint.config.mjs
{
  rules: {
    'no-restricted-imports': ['error', {
      paths: [{
        name: '@astrojs/vue',
        importNames: ['getContainerRenderer'],
        message: "Import getContainerRenderer from '@astrojs/vue/container-renderer' instead.",
      }],
    }],
  },
}

Prevention

When it happens

Trigger: Executing code that imports `{ getContainerRenderer }` from '@astrojs/vue' (the package root) and calls it — typically an experimental container script (`src/content/config.ts`-adjacent `.ts` doing `const renderer = await getContainerRenderer()` combined with ` experimentalContainerMode ` or the Astro Container API in `astro.config`'s content layer, or a custom script using `experimental_AstroContainer`). The warning fires at call time via console.warn, once per call.

Common situations: Following pre-5.x (or early 5.x) Astro docs/blogs for the Container API that used the root import; upgrading @astrojs/vue to a version that split out `container-renderer` without updating the import path; copying container examples from another repo or an AI-generated snippet with the old specifier.

Related errors


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