Can't access KV namespace in local dev [VITE]

I'm pretty sure I'm entering the build command wrong. This will build the project just fine: npx wrangler pages dev -- npm run dev But I can't figure out where to put kv=KV_NAMESPACE npx wrangler pages dev -- kv=KV_NAMESPACE npm run dev is wrong npx wrangler pages dev -- npm run dev kv=KV_NAMESPACE is also wrong npx wrangler pages dev -- npm run dev -- kv=KV_NAMESPACE also seems to be wrong I tried to follow what was suggested in these two pages. https://developers.cloudflare.com/pages/platform/functions/local-development/#run-your-pages-project-locally https://developers.cloudflare.com/pages/platform/functions/bindings/#interact-with-your-kv-namespaces-locally
Bindings · Cloudflare Pages docs
A binding enables your Pages Functions to interact with resources on the Cloudflare developer platform. Use bindings to integrate your Pages Functions …
Local development · Cloudflare Pages docs
Run your Pages application locally with our Wrangler Command Line Interface (CLI).
3 Replies
Taha✨🤓✨
Taha✨🤓✨OP13mo ago
After running npx wrangler pages dev -- npm run dev -kv=DEV_DASHBOARD and logging context.env from the function I get: { ASSETS: Fetcher {} } in the console. In case that is helpful info.
Chaika
Chaika13mo ago
haven't played around with pages dev much but pretty sure you're just putting it on the wrong side of the command. It needs to go to pages dev, not into your run command npx wrangler pages dev --kv=DEV_DASHBOARD -- npm run dev
Taha✨🤓✨
Taha✨🤓✨OP13mo ago
I will name my first born after you
Want results from more Discord servers?
Add your server