nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
400 stars 25 forks source link

Failed to create og image: Image source must be an absolute URL #67

Closed xdeq closed 1 year ago

xdeq commented 1 year ago

Describe the bug

Hi!

Pre-rendering of og images breaks with an error

[log] [nitro] ├─ /docs/__og_image__/og.png (4447ms) (Error: [500] Failed to create og image: Image source must be an absolute URL: undefined/_nuxt/grid.2e3d6f79.png?1691144911540)

In nuxt.config.js:

ogImage: { fonts: ["Montserrat:500", "Inter:400"], }

Also:

site: { url: process.env.NUXT_SITE_URL, },

Reproduction

No response

System / Nuxt Info

No response

xdeq commented 1 year ago

Okay, I figured it out, it was my inattention

For those facing a similar problem:

<img src="@/assets/grid.png" />
<img src="/grid.png" />