Kv not populated when running dev --local

Hello,

I am working on a personnal project. it works really well in production. congratulation to all Cloudflare team.
nevertheless when doing some debug locally npx wrangler dev --local --persist, I would expect wrnagler to populate a local KV (under .wrangler/state I guess) But it does not happen and as I use KV to store static assets my site does not display (it all ended with a bare 404).

Am I wrong assuming that wrangler will act as a local KV ? Do I miss some arg on the wrangler command ?

My project can be found here : https://github.com/b3b00/fsgtTT29-cloudflare/

Thanks for your help

As a side note my worker also uses a D1 database that persists well locally in .wrangler/state/d1

I’ve just found a way to make it work : I 've created a ./wrangler/state/kv/<MY_KV_BINDING>/. And there I 've dropped all my static assets.
It works but I would have hope some more automatic solution.

Looking at your worker, it appears you are only ever getting from KV and not adding any data. My guess is that worker sites does not support using KV local for configuring assets.

Indeed, I only get data from the KV. But when publishing the worker to Cloudflare wrangler sync the ./public folder content with the KV. I was expecting the same when using --local.

You should make a feature request on the repo GitHub - cloudflare/workers-sdk: ⛅️ Home to Wrangler, the CLI for Cloudflare Workers®