{"record":{"id":"c12540765558701e","repo":"withastro/astro","slug":"astrojs-mdx-importing-getcontainerrenderer-fr","errorCode":null,"errorMessage":"[@astrojs/mdx] Importing `getContainerRenderer` from `@astrojs/mdx` is deprecated. Import it from `@astrojs/mdx/container-renderer` instead.","messagePattern":"\\[@astrojs/mdx\\] Importing `getContainerRenderer` from `@astrojs/mdx` is deprecated\\. Import it from `@astrojs/mdx/container-renderer` instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/mdx/src/index.ts","lineNumber":89,"sourceCode":" * MDX pipeline options. Excludes user-only control fields (`extendMarkdownConfig`, `processor`).\n * @internal\n */\nexport type ResolvedMdxOptions = SharedMarkdownOptions & {\n\toptimize: boolean | OptimizeOptions;\n};\n\ntype SetupHookParams = HookParameters<'astro:config:setup'> & {\n\t// `addPageExtension` and `contentEntryType` are not a public APIs\n\t// Add type defs here\n\taddPageExtension: (extension: string) => void;\n\taddContentEntryType: (contentEntryType: ContentEntryType) => void;\n};\n\n/**\n * @deprecated Import `getContainerRenderer` from `@astrojs/mdx/container-renderer` instead.\n */\nexport function getContainerRenderer(): AstroRenderer {\n\tconsole.warn(\n\t\t'[@astrojs/mdx] Importing `getContainerRenderer` from `@astrojs/mdx` is deprecated. Import it from `@astrojs/mdx/container-renderer` instead.',\n\t);\n\treturn getContainerRendererImpl();\n}\n\nexport default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroIntegration {\n\t// @ts-expect-error Temporarily assign an empty object here, which will be re-assigned by the\n\t// `astro:config:done` hook later. This is so that `vitePluginMdx` can get hold of a reference earlier.\n\tlet vitePluginMdxOptions: VitePluginMdxOptions = {};\n\n\treturn {\n\t\tname: '@astrojs/mdx',\n\t\thooks: {\n\t\t\t'astro:config:setup': async (params) => {\n\t\t\t\tconst { updateConfig, config, addPageExtension, addContentEntryType, addRenderer } =\n\t\t\t\t\tparams as SetupHookParams;\n\n\t\t\t\taddRenderer({","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/withastro/astro/blob/e294953aa8aadd98d5be92e60a03037b05dbdfd4/packages/integrations/mdx/src/index.ts#L71-L107","documentation":"The @astrojs/mdx package used to export getContainerRenderer from its root entry for Astro's Containers API. That root export is now a deprecation shim: it logs this console.warn and delegates to the internal getContainerRendererImpl(). The supported import is the @astrojs/mdx/container-renderer subpath export, which returns the renderer directly.","triggerScenarios":"Code like `import { getContainerRenderer } from '@astrojs/mdx'` — typically inside a container-renderer.ts for the experimental Containers API (passed to experimental_AstroContainer.create({ renderers: [...] })) — on any version where the package exposes the container-renderer subpath.","commonSituations":"Following older Containers API docs or examples; upgrading @astrojs/mdx alongside sibling renderer packages (@astrojs/react, vue, svelte, solid) which all moved container renderers to subpath exports.","solutions":["Change the import to `import { getContainerRenderer } from '@astrojs/mdx/container-renderer'`","Audit the rest of your container setup: sibling framework renderers use the same <pkg>/container-renderer convention","Delete any local re-exports of the root getContainerRenderer so call sites cannot regress"],"exampleFix":"// before\nimport { getContainerRenderer } from '@astrojs/mdx';\n\n// after\nimport { getContainerRenderer } from '@astrojs/mdx/container-renderer';","handlingStrategy":"validation","validationCode":"import { getContainerRenderer } from '@astrojs/mdx/container-renderer'; // supported subpath\nexport const renderers = [getContainerRenderer()];","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer the subpath exports documented in each integration's package.json exports map","Add a CI grep for `from '@astrojs/mdx'` imports that pull getContainerRenderer","Track deprecation notes when consuming experimental Container APIs"],"tags":["mdx","deprecation","container-api","subpath-import"],"backgroundTag":"deprecated-import-path","analyzedSha":"e294953aa8aadd98d5be92e60a03037b05dbdfd4","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}