workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: preview KV don't work in worker script

Open zzzh opened this issue 1 year ago • 1 comments

Which Cloudflare product(s) does this pertain to?

KV

What version(s) of the tool(s) are you using?

wrangler 3.13.1

What version of Node are you using?

18.17.1

What operating system are you using?

wsl

Describe the Bug

Hi,

I'm using KV in a worker script, to debug, I create preview version of it, but keep the same name. So, suppose it's name is test, I got a new KV called xxx-test_preview(xxx is my worker's name), and it aks me to add { binding = "test", preview_id = "1dbb89ecb2274a82a448a230b1e6353a" } to wrangler.toml, I did that and commented the product KV with same name. Then when I run wrangler dev, it complains can't find id, so I have to change preview_id to id, this is also an issue, but not the real problem. The real one is I can't get my key in script anymore!

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

zzzh avatar Oct 14 '23 04:10 zzzh

@zzzh sorry about the issues you were running into. preview_id is only needed if you are running wrangler dev --remote. Otherwise, id will work for production and local. A description about this can be found here.

This shouldn't affect your script at all though. Were you able to get that resolved?

admah avatar Feb 26 '24 16:02 admah

hey @zzzh :) we haven't heard from you in a while so we’re going to close this issue for now, but if this is still a problem, please feel free to open a new issue referencing this one. please be sure to include an updated summary and any additional requested details, followup, or context and we will revisit and investigate further. thanks!

lrapoport-cf avatar Mar 11 '24 14:03 lrapoport-cf