cloudflare / wrangler-legacy

🤠 Home to Wrangler v1 (deprecated)
https://workers.cloudflare.com
Apache License 2.0
3.2k stars 337 forks source link

[[kv-namespaces]] in wrangler.toml throwing error #415

Closed mrpatrick closed 5 years ago

mrpatrick commented 5 years ago

🐛 Bug Report

It seems like I must be doing something wrong, but I keep getting errors with the new kv-namespaces option for wrangler.toml as documented in the README. Everything works fine if I remove [[kv-namespaces]] from wrangler.toml

Environment

Steps to reproduce

wrangler.toml:

name = "MY_WORKER_NAME"
type = "webpack"
zone_id = "MY_ZONE_ID"
private = true
account_id = "MY_ACCOUNT_ID"
route = "MY_ROUTE"
[[kv-namespaces]]
binding = "MY_BINDING_NAME"
id = "MY_NAMESPACE_ID"

Run: wrangler publish --release

What did you expect to see?

⬇️ Installing wasm-pack...
⬇️ Installing wranglerjs...
 Built successfully.
🥳 Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at ...

What did you see instead?

Error: ErrorMessage { msg: "⚠\u{fe0f} Your project config has an error, check your `wrangler.toml`: invalid type: map, expected a string for key `kv-namespaces[0]` in wrangler.toml" }
EverlastingBugstopper commented 5 years ago

My guess is that you are running an old version of wrangler. Could you check wrangler --version and see if it says 1.1.0? If not, follow these steps!

mrpatrick commented 5 years ago

Doh! I had the wrong version. Thanks @EverlastingBugstopper

EverlastingBugstopper commented 5 years ago

You got it! Glad we could help 😄