Skip to content

Unable to resolve dynamic ogImage object value #769

Closed

Description

@danielwaltz

Environment

[email protected]
[email protected]
[email protected]

Reproduction

Updating an example to use this structure should be able to reproduce.

Describe the bug

When setting an ogImage using a ref or a getter function on the useSeoMeta composable in a Nuxt application using an array or object syntax, the value of the meta tag displays as [Object Object]:

useSeoMeta({
  ogImage: () => [{ url: "https://example.com/og-image.png" }], // ❌ broken
  ogImage: computed(() => [{ url: "https://example.com/og-image.png" }]), // ❌ broken
  ogImage: () => { url: "https://example.com/og-image.png" }, // ❌ broken
  ogImage: { url: "https://example.com/og-image.png" }, // ✅ works
});
<meta property="og:image" content="[object Object]">

Additional context

If you are unable to easily/quickly reproduce let me know and I can work on creating a reproduction!

Thanks. ❤️

Logs

Activity

  1. added
    bug
    on Jun 11, 2026
  2. MaitreyeeDeshmukh commented on Jun 11, 2026

    @MaitreyeeDeshmukh

    Hi! I tried reproducing this on both v2.1.15 and v3.1.3 but couldn't get [object Object] output in any of the three cases. All getter and computed variants produce correct tags in my tests.
    Would you be able to share a minimal reproduction (a StackBlitz or repo)? That would help pinpoint exactly where it's going wrong for you.

  3. danielwaltz commented on Jun 11, 2026

    @danielwaltz
    Author

    Ah, I found the missing thread! I tested on a few of my other Nuxt projects and found that it was indeed inconsistent to reproduce. I only had luck reproducing when using Nuxt projects with the nuxt-seo-utils module loaded (https://nuxt.com/modules/seo-experiments).

    This could mean it is not directly related to an issue with unhead, but difficult to say without deeper investigation. At least explains why it is not directly reproducible.

    I made a minimal reproduction here that has the module loaded so you can see the issue: https://stackblitz.com/edit/nuxt-starter-fetxjape?file=app.vue

  4. harlan-zw commented on Jun 11, 2026

    @harlan-zw
    Collaborator

    Hi, so one of the Nuxt package versions accidentally shipped with Unhead v3, which forced Nuxt to use the tree-shake transformer for useSeoMeta. This had the bug you described, it's fixed in #770. I'll have a release tomorrow.

    Nuxt SEO Utils also uses this, possibly an accidental v3 major upgrade there too if it's not the Nuxt one 🤔

  5. added a commit that references this issue on Jun 12, 2026
    06a859b
  6. harlan-zw commented on Jun 12, 2026

    @harlan-zw
    Collaborator

    Out now :)

  7. danielwaltz commented on Jun 12, 2026

    @danielwaltz
    Author

    Can confirm after updating the issue is resolved. Appreciate the quick work! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions