diff --git a/packages/nuxt/src/app/components/nuxt-island.ts b/packages/nuxt/src/app/components/nuxt-island.ts index e17304c3e0..287f5768da 100644 --- a/packages/nuxt/src/app/components/nuxt-island.ts +++ b/packages/nuxt/src/app/components/nuxt-island.ts @@ -126,13 +126,13 @@ export default defineComponent({ } } - const key = `${props.name}_${hashId.value}` - const ssrHTML = ref(nuxtApp.payload.data[key]?.html || '') + const cmpKey = `${props.name}_${hashId.value}` + const ssrHTML = ref(nuxtApp.payload.data[cmpKey]?.html || '') if (import.meta.client && instance.vnode?.el && !ssrHTML.value) { ssrHTML.value = getFragmentHTML(instance.vnode.el, true)?.join('') || '' - nuxtApp.payload.data[key] ||= {} - nuxtApp.payload.data[key].html = ssrHTML.value + nuxtApp.payload.data[cmpKey] ||= {} + nuxtApp.payload.data[cmpKey].html = ssrHTML.value } const uid = ref(ssrHTML.value.match(SSR_UID_RE)?.[1] ?? getId())