{"record":{"id":"9cfcde572a0b0be2","repo":"withastro/astro","slug":"astrojs-react-importing-getcontainerrenderer","errorCode":null,"errorMessage":"[@astrojs/react] Importing `getContainerRenderer` from `@astrojs/react` is deprecated. Import it from `@astrojs/react/container-renderer` instead.","messagePattern":"\\[@astrojs/react\\] Importing `getContainerRenderer` from `@astrojs/react` is deprecated\\. Import it from `@astrojs/react/container-renderer` instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/react/src/index.ts","lineNumber":216,"sourceCode":"\t\t\t\tconst enabledKnownJsxRenderers = config.integrations.filter((renderer) =>\n\t\t\t\t\tknownJsxRenderers.includes(renderer.name),\n\t\t\t\t);\n\n\t\t\t\tif (enabledKnownJsxRenderers.length > 1 && !include && !exclude) {\n\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t'More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/react/#combining-multiple-jsx-frameworks for more information.',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * @deprecated Import `getContainerRenderer` from `@astrojs/react/container-renderer` instead.\n */\nexport function getContainerRenderer(): AstroRenderer {\n\tconsole.warn(\n\t\t'[@astrojs/react] Importing `getContainerRenderer` from `@astrojs/react` is deprecated. Import it from `@astrojs/react/container-renderer` instead.',\n\t);\n\treturn getContainerRendererImpl();\n}\n","sourceCodeStart":198,"sourceCodeEnd":221,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/integrations/react/src/index.ts#L198-L221","documentation":"@astrojs/react keeps a deprecated getContainerRenderer() export on the package root that console.warns and forwards to the real implementation in ./container-renderer. It exists so older manual-SSR setups (experimental_AstroContainer with an Express/Hono server) keep working, but the root export is scheduled for removal in favor of the @astrojs/react/container-renderer subpath.","triggerScenarios":" Server code imports { getContainerRenderer } from '@astrojs/react' (root entry) to register the renderer on an AstroContainer instance, e.g. container.addRenderer({ name: 'react', serverEntrypoint: await getContainerRenderer() }).","commonSituations":" Upgrading @astrojs/react after container APIs moved to a subpath; copying older custom SSR server examples; NestJS/Hono integrations written against the previous export surface.","solutions":["Import from the subpath: import { getContainerRenderer } from '@astrojs/react/container-renderer';","Grep the repo for from '@astrojs/react' destructuring getContainerRenderer and update every occurrence.","Re-run the server; the warning should not print again."],"exampleFix":"// before\nimport { getContainerRenderer } from '@astrojs/react';\nContainer.addRenderer({ name: 'react', serverEntrypoint: await getContainerRenderer() });\n\n// after\nimport { getContainerRenderer } from '@astrojs/react/container-renderer';\nContainer.addRenderer({ name: 'react', serverEntrypoint: await getContainerRenderer() });","handlingStrategy":"validation","validationCode":"const src = await readFile('server.ts', 'utf8');\nif (src.includes(\"{ getContainerRenderer } from '@astrojs/react'\")) {\n  throw new Error(\"Import getContainerRenderer from '@astrojs/react/container-renderer'\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Import container renderers from the /container-renderer subpath only.","Use no-restricted-imports lint rules to block the root-path named import.","Upgrade custom SSR servers in lockstep with @astrojs/react major versions."],"tags":["react","deprecation","container-renderer","ssr","import-path"],"backgroundTag":"deprecated-import-path","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}