`useHead` does not resolve reactive input on the client
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- nuxtjs, typescript
Línea de trabajo
Comienza en src/runtime/composables/head.ts inspeccionando cada sitio activo de activeHead.push() y patch() junto con el comportamiento de clientUseHead de @unhead/vue y su resolución basada en watchEffect. Usa la reproducción enlazada para verificar que las props reactivas se resuelvan en el cliente, se actualicen cuando cambien sus refs y ya no impidan que las etiquetas head lleguen al DOM.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 The bug
The module's useHead replacement (src/runtime/composables/head.ts) never resolves reactive input. All of its activeHead.push() / patch() sites hand the raw object to unhead, while @unhead/vue's own clientUseHead runs walkResolver(input, VueResolver) inside a watchEffect.
This only bites on the client: @unhead/vue/server creates the head with propResolvers: [VueResolver], so refs resolve inside unhead during SSR. The client head has no prop resolver, so resolution exists only in the composable this module replaces.
Two consequences:
-
Crash — a ref on
innerHTML/textContentof astyle/scriptreaches unhead'snormalizeProps, which JSON-stringifies object values:TypeError: Converting circular structure to JSON --> starting at object with constructor 'ComputedRefImpl' | property 'dep' -> object with constructor 'Dep' --- property 'computed' closes the circle at JSON.stringify (<anonymous>) at normalizeProps (unhead.js:148:28) at normalizeTag (unhead.js:175:15) at normalizeEntryToTags (unhead.js:209:56) at resolveTags (unhead.js:362:16) at _renderDOMHead (unhead.js:183:21)It is thrown inside the debounced
_renderDOMHead, so the whole head render is abandoned: the tag never lands in the DOM, and it can abort router start. -
Silent, for every other prop: the ref object is used instead of its
.value, and since there is nowatchEffect, the tag never updates when the ref changes. Client-side reactive head does not work, though unhead v3 documents it as supported.
@nuxt/ui triggers case 1 out of the box: its colors plugin calls useHead({ style: [{ innerHTML: root, id: 'nuxt-ui-colors' }] }) where root is a computed. Any @nuxtjs/ionic + @nuxt/ui app loses its theme colors style. @nuxtjs/i18n's useLocaleHead() and @nuxtjs/seo hit case 2.
🛠️ To reproduce
https://github.com/Carpediem94/nuxt-ionic-head-repro
🌈 Expected behaviour
Reactive input resolved before being pushed to unhead, and kept in sync as it changes, matching the behaviour of @unhead/vue's useHead.
ℹ️ Additional context
@nuxtjs/ionic 1.0.2, nuxt 4.5.2, @unhead/vue 3.3.1, @nuxt/ui 4.10.0.
Same error class as https://github.com/unjs/unhead/issues/869, but that fix only covered the SSR streaming serializer.
- Lenguaje dominante
- TypeScript
- Estrellas
- 457
- Forks
- 53
- Merge medio
- 15 h 54 min
- PR fusionados (30 d)
- 25
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nuxt-modules/ionic
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
nuxt-modules/ionic#908 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
nuxt-modules/ionic#867 ·
Los mantenedores suelen responder en 1 día
-
bug needs reproduction
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
nuxt-modules/ionic#696 ·
Los mantenedores suelen responder en 1 día
-
IonCardAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
nuxt-modules/ionic#610 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Wrong tabs navigation behaviorAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
nuxt-modules/ionic#603 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de nuxt-modules/ionic
Issues similares
-
refactor
Dificultad 2/5 Medio día Aptitud para principiantes 84/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OHDSI/Data2Evidence#3450 ·
Los mantenedores suelen responder en 2 días
-
e2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
redhat-developer/rhdh-plugin-export-overlays#4011 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
automation missing-model model-sync provider:ofox
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/models.dev#8421 ·
Los mantenedores suelen responder en 1 día
-
SlackAdapter and TelegramAdapter are not assignable to Adapter under exactOptionalPropertyTypesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día