Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] KV binding for nuxt og image #501

Closed
remihuigen opened this issue Mar 17, 2025 · 2 comments
Closed

[question] KV binding for nuxt og image #501

remihuigen opened this issue Mar 17, 2025 · 2 comments
Labels
question Further information is requested

Comments

@remihuigen
Copy link

Describe the bug
When following the example given in the nuxt og image docs (https://nuxtseo.com/docs/og-image/guides/cache#cache-storage) for setting a cache storage, I'm getting an error 👇

// nuxt.config.ts
ogImage: {
  runtimeCacheStorage: {
    driver: 'cloudflare-kv-binding',
    binding: 'OG_IMAGE_CACHE'
  }
}
{
  "error": "true",
  "url": "/__og-image__/image/dev/og.png",
  "statusCode": 500,
  "statusMessage": "[Nuxt OG Image] Failed to connect to cache /nuxt-og-image/5.0.2. Response from cache: [unstorage] [cloudflare] Invalid binding `OG_IMAGE_CACHE`: `undefined`",
  "message": "[Nuxt OG Image] Failed to connect to cache /nuxt-og-image/5.0.2. Response from cache: [unstorage] [cloudflare] Invalid binding `OG_IMAGE_CACHE`: `undefined`"
}

How can i set the correct binding?

@remihuigen remihuigen added the bug Something isn't working label Mar 17, 2025
@atinux
Copy link
Contributor

atinux commented Mar 18, 2025

Could you try with:

ogImage: {
  runtimeCacheStorage: {
    driver: 'cloudflare-kv-binding',
    binding: 'CACHE'
  }
}

and enable:

hub: {
  cache: true
}

@atinux atinux added question Further information is requested and removed bug Something isn't working labels Mar 18, 2025
@remihuigen
Copy link
Author

Yes that was it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants