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

🐛 BUG: Calling wrangler publish will remove KV bindings

Open davemurphysf opened this issue 3 years ago • 0 comments

What version of Wrangler are you using?

2.0.28

What operating system are you using?

Mac

Describe the Bug

(copied from https://github.com/cloudflare/wrangler/issues/2301)

🐛 Bug report

Describe the bug

On wrangler 2.0.28 (and possibly 2.0.26), after I call wrangler publish without a wrangler.toml file, my KV bindings are removed from my worker. My full publish command in case its relevant: wrangler publish dist/index.mjs --name auth --tsconfig ./tsconfig.json --latest

Reproduce the bug

  1. wrangler login
  2. wrangler init wrangTest --yes
  3. cd wrangTest && rm wrangler.toml
  4. wrangler publish src/index.ts --name wrangtest --latest
  5. [Add KV binding to worker in dashboard. Name and which KV namespace does not matter]
  6. Run wrangler publish src/index.ts --name wrangtest --latest again
  7. KV binding will be gone :-(

Expected behavior

Existing KV binding should not be removed on wrangler publish

Environment and versions

Fill out the following information about your environment.

  • operating system: MacOS Monterey 12.5.1
  • output of wrangler -V: ⛅️ wrangler 2.0.28
  • output of node -v: v18.7.0
  • content of wrangler.toml: no wrangler.toml

davemurphysf avatar Sep 04 '22 20:09 davemurphysf