nuxt-modules / og-image

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

Upgrading to beta.55 prerender fails #131

Closed cmcnicholas closed 4 months ago

cmcnicholas commented 5 months ago

Describe the bug

After updating to beta.55 I get the following as nuxt tries to prerender the og-image routes, this wasn't happening before and couldn't see anything in the documentation. Are we expected to specify in nuxt config to opt og-image route out of pre-rendering?

✔ Server built in 12685ms
[nitro] ℹ Initializing prerenderer
[nitro] ℹ Prerendering 2 routes
[nitro]   ├─ /__og-image__/font/Inter/700.ttf (11ms)
  │ └── Error: [401] 
[nitro]   ├─ /__og-image__/font/Inter/400.ttf (5ms)
  │ └── Error: [401] 
[nitro]
Errors prerendering:
[nitro]   ├─ /__og-image__/font/Inter/700.ttf (11ms)
  │ └── Error: [401] 
[nitro]   ├─ /__og-image__/font/Inter/400.ttf (5ms)
  │ └── Error: [401] 
[nitro]

Reproduction

No response

System / Nuxt Info

No response

cmcnicholas commented 5 months ago

Tested by optiming the /__og-image__/ path out of prerendering in nuxt config and it's working

  routeRules: {
    '/__og-image__/**': {
      prerender: false,
    },
  },
harlan-zw commented 5 months ago

Hi, looks like it's failing with an unauthorized HTTP status when trying to request the Inter font from the Google API. Could you share some details about what environment you're building with?

cmcnicholas commented 5 months ago

Hi, looks like it's failing with an unauthorized HTTP status when trying to request the Inter font from the Google API. Could you share some details about what environment you're building with?

------------------------------
- Operating System: Windows_NT
- Node Version:     v20.10.0
- Nuxt Version:     3.9.0
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  npm@9.1.2
- Builder:          -
- User Config:      alias, devtools, nitro, modules, vite, site, robots, linkChecker, basicAuth, runtimeConfig, imports, routeRules, typescript
- Runtime Modules:  @vueuse/nuxt@10.7.1, @pinia/nuxt, @nuxtseo/module, @kgierke/nuxt-basic-auth
- Build Modules:    -
------------------------------
harlan-zw commented 4 months ago

Hi, this should be fixed in nuxt-og-image@3.0.0-rc.36, let me know how you go :)

You should also consider using the googleFontMirror: true config if you need to use a Google Font as it seems like a firewall issue.