cloudflare / cloudflare/vinext
Cache adapter registration always warns on Node-runtime runs (`vinext build` prerender / `vinext start`)
- Dominant language
- TypeScript
- Stars
- 8.8k
- Forks
- 406
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 120
Description
With `vinext({ cache: { data: kvDataAdapter() } })` configured, every `vinext build` and
`vinext start` run emits:
```
[vinext] failed to initialize the configured data cache adapter; using the default handler.
[vinext] The KV data cache adapter requires a `VINEXT_KV_CACHE` KV namespace binding.
Add it to wrangler.jsonc:
"kv_namespaces": [{ "binding": "VINEXT_KV_CACHE", "id": "" }]
```
The `VINEXT_KV_CACHE` binding is correctly declared in `wrangler.jsonc`, and the KV cache
works fine under `vinext dev` and in the deployed Worker. The warning therefore does not
indicate a misconfiguration, and there is no way to silence it.
### Steps to reproduce
1. Configure `vinext({ cache: { data: kvDataAdapter() }, prerender: { routes: '*' } })` in `vite.config.ts`
2. Add `"kv_namespaces": [{ "binding": "VINEXT_KV_CACHE" }]` to `wrangler.jsonc`
(present or absent `id` makes no difference)
3. Run `vinext build`
### Expected behavior
No warning about a binding that cannot exist when the app runs outside the Workers runtime.
### Environment
- vinext: 1.0.0-beta.8
- @vinext/cloudflare: 1.0.0-beta.6
- wrangler: 4.127.1
- @cloudflare/vite-plugin: 1.54.2
- vite: 8.2.2
Contributor guide
Research direction
Start with vite.config.ts and wrangler.jsonc, then run vinext build with the configured kvDataAdapter and prerender route. Trace how cache adapter initialization behaves outside the Workers runtime; done when vinext build and vinext start no longer warn about VINEXT_KV_CACHE while dev and deployed Worker behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100