Skip to content

Conversation

@onmax
Copy link
Contributor

@onmax onmax commented Jan 2, 2026

Fixes #766

Problem

When explicitly setting driver: 'cloudflare-kv-binding' in hub.kv/cache config, resolveKVConfig() and resolveCacheConfig() return early without merging the default binding. This causes unstorage to fall back to 'STORAGE' binding which doesn't exist.

Solution

Merge default binding ('KV' for kv, 'CACHE' for cache) when driver is explicitly set to cloudflare-kv-binding.

Reproduce bug

git clone --depth 1 --filter=blob:none --sparse https://github.com/onmax/repros.git
cd repros && git sparse-checkout set nuxthub-766
cd nuxthub-766 && pnpm i && pnpm build && cat .nuxt/hub/kv.mjs

Shows driver({}) - empty options.

Verify fix

git sparse-checkout add nuxthub-766-fixed
cd ../nuxthub-766-fixed && pnpm i && pnpm build && cat .nuxt/hub/kv.mjs

Shows driver({"binding":"KV"}).

Test?

Let me know if we should include tests to avoid future regressions

@vercel
Copy link

vercel bot commented Jan 2, 2026

@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KV binding defaults to STORAGE when driver explicitly set

1 participant