nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
MIT License
418 stars 29 forks source link

Using <slot> in a component causes OgImage generation issues #241

Closed BghinC closed 2 months ago

BghinC commented 4 months ago

I have a template in components/OgImage called using defineOgImageComponent. That template uses other components, but one of them uses <slot>. It used to work a couple of months ago.

I recently observed two different behaviors:

You can find the reproduction here

harlan-zw commented 2 months ago

Thanks for the issue, I've taken a look and it appears to be an upstream Nuxt issue with using nested island components.

The simple workaround is to move the sub component into the components dir.

See https://stackblitz.com/edit/nuxt-starter-vdfkge?file=components%2Fglobals%2FMyTemplateItem.vue