{"record":{"id":"27205c186212727d","repo":"withastro/astro","slug":"could-not-find-server-component-name-componentpa","errorCode":null,"errorMessage":"Could not find server component name ${componentPath}","messagePattern":"Could not find server component name (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/astro/src/runtime/server/render/server-islands.ts","lineNumber":134,"sourceCode":"\n\tasync getHostId() {\n\t\tif (!this.hostId) {\n\t\t\tthis.hostId = await crypto.randomUUID();\n\t\t}\n\t\treturn this.hostId;\n\t}\n\n\tasync getIslandContent() {\n\t\tif (this.islandContent) {\n\t\t\treturn this.islandContent;\n\t\t}\n\n\t\tconst componentPath = this.getComponentPath();\n\t\tconst componentExport = this.getComponentExport();\n\t\tconst serverIslandNameMap = await this.result.getServerIslandNameMap();\n\t\tlet componentId = serverIslandNameMap.get(componentPath);\n\t\tif (!componentId) {\n\t\t\tthrow new Error(`Could not find server component name ${componentPath}`);\n\t\t}\n\n\t\t// Remove internal props\n\t\tfor (const key of Object.keys(this.props)) {\n\t\t\tif (internalProps.has(key)) {\n\t\t\t\tdelete this.props[key];\n\t\t\t}\n\t\t}\n\n\t\t// Render the slots\n\t\tconst renderedSlots: Record<string, string> = {};\n\t\tfor (const name in this.slots) {\n\t\t\tif (name !== 'fallback') {\n\t\t\t\tconst content = await renderSlotToString(this.result, this.slots[name]);\n\t\t\t\t// renderSlotToString returns a SlotString (typed as string) whose\n\t\t\t\t// `chunks` hold the ordered content stream. Scripts live inline there,\n\t\t\t\t// so walking it keeps them at their original position in the island\n\t\t\t\t// response instead of being appended at the end.","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/runtime/server/render/server-islands.ts#L116-L152","documentation":"Thrown while rendering a server island (a component using the experimental server:defer directive). Before rendering the deferred content, Astro resolves the island component's file path to an internal component id via a name map (serverIslandNameMap) generated by the server-islands Vite plugin at build time. This error means the map returned nothing for that component path, so Astro cannot load the island's server-side implementation. It almost always indicates a mismatch between the compiled page and the generated island manifest, not a mistake in the page markup.","triggerScenarios":"A page uses <Comp server:defer /> but the SSR manifest's serverIslandNameMap is missing or empty (the plugin that generates it substitutes new Map() in environments it does not handle); rendering such a page through a custom SSR entrypoint or adapter that did not include the map; stale build output where the page was compiled by a different Astro version than the runtime serving it.","commonSituations":"Upgrading Astro while deployed build output is from an older version; enabling experimental.serverIslands with an adapter that predates them; rendering via a custom app/container that bypasses the generated virtual module; leftover dist/ or .astro cache after switching branches or versions.","solutions":["Update astro and your deployment adapter (@astrojs/node, etc.) to the latest versions so both sides generate and consume the server island name map, then rebuild from a clean state","Delete stale build output (dist/, .astro/) and the Vite cache (node_modules/.vite), then build again","If you render through a custom SSR entrypoint, make sure the manifest passed to the app includes serverIslandNameMap from the built virtual module","If it reproduces on current versions with experimental.serverIslands enabled, file an Astro issue with a minimal reproduction"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n\tconst response = await app.render(request);\n} catch (err) {\n\tif (err instanceof Error && err.message.includes('Could not find server component name')) {\n\t\t// island name map is stale: clean build output, align astro/adapter versions, rebuild\n\t}\n\tthrow err;\n}","preventionTips":["Keep astro and your adapter upgraded together so the island name map is generated and consumed by matching versions","Build from a clean state in CI (no cached dist/ or .astro output across Astro upgrades)","Only use server:defer on .astro components imported through the normal compile pipeline, not dynamic runtime constructs"],"tags":["server-islands","ssr","experimental","manifest"],"backgroundTag":"missing-build-manifest-entry","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"}