Skip to content

v2 breaks vue Style component inside Head component in Nuxt v3.16 #517

@lehni

Description

@lehni

Environment

Nuxt v3.16 / unhead v2

Describe the bug

Up to Nuxt 3.15.4, this used to work as expected in the default.vue layout component:

<template lang="html">
  <Head>
    <Style children="body { background: red }" />
  </Head>
</template>

Nuxt v3.16 breaks this due to unhead v2. Even switching children to textContent doesn't fix it, I need to deploy an additional awkward workaround for it to work again, using <component :is="'style'">:

<template lang="html">
  <Head>
    <component :is="'Style'" textContent="body { background: red }" />
  </Head>
</template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions