Worker KV configuration needs to be fixed or notification added

For Workes & Pages, what is the name of the domain?

What is the issue or error you’re encountering

wrangler.toml KVnamespace binding problem

What steps have you taken to resolve the issue?

when using CF workers and KV, we configure at wrangler.toml

the order of configuration matters

What are the steps to reproduce the issue?

This not works - This works - kv_namespaces after [var]

name = "worker
main = "src/index.ts"

[vars]
...

kv_namespaces = [
  { binding = "KV_JWK",preview_id ="<YOUR KV ID>", id = "<YOUR KV ID>" }
]

This works - kv_namespaces before [var]

name = "worker
main = "src/index.ts"

kv_namespaces = [
  { binding = "KV_JWK",preview_id ="<YOUR KV ID>", id = "<YOUR KV ID>" }
]

[vars]
...

needs to be notified in docs, or toml configuration should be encouraged to write like this:

[[kv_namespaces]]
binding = "<BINDING_NAME1>"
id = "<NAMESPACE_ID1>"

I spent hours finding out what was the problem, so it will be really helpful warning incoming users

when kv_namespace are under [vars] logs are printed like

- Vars:                                                                                                                                                                    
  - MS_JWK_ENDPOINT: "https://login.microsoftonline.com/com..."                                                                                                            
  - kv_namespaces: [
 {
  "binding": "KV_JWK",
  "preview_id": "<Your KV ID>",
  "id": "<Your KV ID>"
 }
]

it just looks like there are no problems

it will be really helpful if wrangler warns

when known keywords like ‘kv_namepaces’ are under [vars] configuration