diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index 027c69ef4..d839eafe2 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -239,7 +239,8 @@ export async function renderComponent(result: SSRResult, displayName: string, Co return html.replace(/\<\/?astro-fragment\>/g, ''); } - const astroId = shorthash.unique(html); + // Include componentExport name and componentUrl in hash to dedupe identical islands + const astroId = shorthash.unique(`\n${html}`); result.scripts.add(await generateHydrateScript({ renderer, astroId, props }, metadata as Required));