withastro/astro · warning
[@astrojs/solid-js] Importing `getContainerRenderer` from `@
Error message
[@astrojs/solid-js] Importing `getContainerRenderer` from `@astrojs/solid-js` is deprecated. Import it from `@astrojs/solid-js/container-renderer` instead.
What it means
@astrojs/solid-js retains a getContainerRenderer() export on its root entry as a deprecated shim: calling it console.warns and forwards to the implementation from ./container-renderer. Manual SSR setups using experimental_AstroContainer keep working, but the root export will be removed in favor of the @astrojs/solid-js/container-renderer subpath.
Source
Thrown at packages/integrations/solid/src/index.ts:67
solidNoExternal: string[],
) {
const plugins: PluginOption[] = [
solid({ include, exclude, ssr: true }),
configEnvironmentPlugin(solidNoExternal),
];
if (devtoolsPlugin) {
plugins.push(devtoolsPlugin({ autoname: true }));
}
return { plugins };
}
/**
* @deprecated Import `getContainerRenderer` from `@astrojs/solid-js/container-renderer` instead.
*/
export function getContainerRenderer(): AstroRenderer {
console.warn(
'[@astrojs/solid-js] Importing `getContainerRenderer` from `@astrojs/solid-js` is deprecated. Import it from `@astrojs/solid-js/container-renderer` instead.',
);
return getContainerRendererImpl();
}
export interface Options extends Pick<ViteSolidPluginOptions, 'include' | 'exclude'> {
devtools?: boolean;
}
export default function (options: Options = {}): AstroIntegration {
return {
name: '@astrojs/solid-js',
hooks: {
'astro:config:setup': async ({
command,
config,
addRenderer,
updateConfig,View on GitHub (pinned to 52e6c34790)
Solutions
- Switch the import to the subpath: import { getContainerRenderer } from '@astrojs/solid-js/container-renderer';
- Register the renderer once and reuse the container instead of per-request (also silences repeated warns).
- Update any typed re-exports of the root module that surface getContainerRenderer.
Example fix
// before
import { getContainerRenderer } from '@astrojs/solid-js';
Container.addRenderer({ name: 'solid-js', serverEntrypoint: await getContainerRenderer() });
// after
import { getContainerRenderer } from '@astrojs/solid-js/container-renderer';
Container.addRenderer({ name: 'solid-js', serverEntrypoint: await getContainerRenderer() }); Defensive patterns
Strategy: validation
Validate before calling
const src = await readFile('server.ts', 'utf8');
if (src.includes("{ getContainerRenderer } from '@astrojs/solid-js'")) {
throw new Error("Import getContainerRenderer from '@astrojs/solid-js/container-renderer'");
} Prevention
- Import container renderers from the /container-renderer subpath only.
- Create the AstroContainer and register renderers once, then reuse it.
- Use lint no-restricted-imports to keep the named import off the root path.
When it happens
Trigger: Custom server code (Express/Hono/Nest) imports { getContainerRenderer } from '@astrojs/solid-js' and passes it to Container.addRenderer(). Every call triggers the console.warn before delegating to getContainerRendererImpl().
Common situations: Upgrading @astrojs/solid-js after the container APIs moved to a subpath; older custom-SSR examples; renderers registered per-request, which prints the warning on each render.
Related errors
- [@astrojs/preact] Importing `getContainerRenderer` from `@as
- [@astrojs/react] Importing `getContainerRenderer` from `@ast
- [@astrojs/svelte] Importing `getContainerRenderer` from `@as
- The @astrojs/netlify/functions import is deprecated and will
- The @astrojs/netlify/static import is deprecated and will be
AI-assisted analysis of withastro/astro@52e6c34790 (2026-08-18).
Data as JSON: /api/errors/53f5dc98ac025ed9.
Report an issue: GitHub.