{"record":{"id":"1158268204a44256","repo":"withastro/astro","slug":"you-tried-to-add-the-name-client-renderer-but","errorCode":null,"errorMessage":"You tried to add the ${name} client renderer, but its server renderer wasn't added. You must add the server renderer first. Use the `addServerRenderer` function.","messagePattern":"You tried to add the (.+?) client renderer, but its server renderer wasn't added\\. You must add the server renderer first\\. Use the `addServerRenderer` function\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/astro/src/container/index.ts","lineNumber":425,"sourceCode":"\t *\n\t * const container = await AstroContainer.create();\n\t * container.addServerRenderer(reactRenderer);\n\t * container.addClientRenderer({\n\t * \tname: \"@astrojs/react\",\n\t * \tentrypoint: \"@astrojs/react/client.js\"\n\t * });\n\t * ```\n\t *\n\t * @param options {object}\n\t * @param options.name The name of the renderer. The name **isn't** arbitrary, and it should match the name of the package.\n\t * @param options.entrypoint The entrypoint of the client renderer.\n\t */\n\tpublic addClientRenderer(options: AddClientRenderer): void {\n\t\tconst { entrypoint, name } = options;\n\n\t\tconst rendererIndex = this.#pipeline.manifest.renderers.findIndex((r) => r.name === name);\n\t\tif (rendererIndex === -1) {\n\t\t\tthrow new Error(\n\t\t\t\t'You tried to add the ' +\n\t\t\t\t\tname +\n\t\t\t\t\t\" client renderer, but its server renderer wasn't added. You must add the server renderer first. Use the `addServerRenderer` function.\",\n\t\t\t);\n\t\t}\n\t\tconst renderer = this.#pipeline.manifest.renderers[rendererIndex];\n\t\trenderer.clientEntrypoint = entrypoint;\n\n\t\tthis.#pipeline.manifest.renderers[rendererIndex] = renderer;\n\t}\n\n\t// NOTE: we keep this private via TS instead via `#` so it's still available on the surface, so we can play with it.\n\t// @ts-expect-error @ematipico: I plan to use it for a possible integration that could help people\n\tprivate static async createFromManifest(\n\t\tmanifest: SSRManifest,\n\t): Promise<experimental_AstroContainer> {\n\t\tconst container = new experimental_AstroContainer({\n\t\t\tmanifest,","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/container/index.ts#L407-L443","documentation":"Client renderers hydrate `client:*` components in the browser, but they must be paired with a server renderer already present in the manifest. `addClientRenderer` looks up the renderer by `name` and attaches its `clientEntrypoint`; if no server renderer with that name exists, the lookup returns `-1` and the call is rejected.","triggerScenarios":"Calling `container.addClientRenderer({ name, entrypoint })` before the matching `container.addServerRenderer(...)` for the same `name`.","commonSituations":"Reversing the documented add-server-then-add-client order; name mismatch (e.g. server registered as `'@astrojs/react'` but client passed as `'react'`); forgetting to call `addServerRenderer` at all when using `AstroContainer.create()` from a minimal manifest.","solutions":["Call `addServerRenderer` with the same `name` before `addClientRenderer`.","Verify the `name` strings match exactly (usually the integration package name, e.g. `@astrojs/react`).","If rendering server-only components, you can skip `addClientRenderer` entirely."],"exampleFix":"// before\ncontainer.addClientRenderer({ name: '@astrojs/react', entrypoint: '@astrojs/react/client.js' });\n// after\ncontainer.addServerRenderer(reactRenderer);\ncontainer.addClientRenderer({ name: '@astrojs/react', entrypoint: '@astrojs/react/client.js' });","handlingStrategy":"validation","validationCode":"const has = container['#pipeline'].manifest.renderers.some(r => r.name === name);\nif (!has) throw new Error(`Add server renderer ${name} first`);","typeGuard":"function serverRendererRegistered(manifest, name) {\n  return manifest.renderers.some(r => r.name === name);\n}","tryCatchPattern":null,"preventionTips":["Always call `addServerRenderer` before `addClientRenderer` with matching names.","Keep a single source of truth for the renderer name string."],"tags":["container","ssr","renderer","hydration","ordering"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}