question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prompt when `kv_namespaces` is defined but not in all environments

See original GitHub issue

As per https://github.com/cloudflare/cloudflare-docs/issues/3998 which talks about the clarity around kv_namespaces not being inherited into environments, I think it’d be beneficial if wrangler prompted if there’s environments that don’t have kv_namespaces defined when others do (or if the kv_namespaces is in the top-level scope).

As an example, in the below scenario, the test environment will not have the binding for the TODO namespace.

name = "worker"

# ...

kv_namespaces = [ 
  { binding = "TODO", id = "06779da6940b431db6e566b4846d64db" }
]

[env.test]
name = "worker-test"

Maybe wrangler could prompt about this - such as “The TODO namespace will not be inherited by the test environment. Please define it under this environment if you’d like to bind it.” - to give some clarity to the user.

I’m sure there’s a better way to word it than I did though :^)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
KianNHcommented, Apr 3, 2022

I think that message is pretty good - let’s them know all the details they need.

Gives me a nudge to start using wrangler2 myself too!

0reactions
petebacondarwincommented, Apr 3, 2022

No problem @KianNH - we definitely appreciate issue reports. Even better when we have already fixed the issue! Shall we close this then, or do we need to improve the message further?

Read more comments on GitHub >

github_iconTop Results From Across the Web

KV namespace not found · Issue #1902 · cloudflare/wrangler
go to Settings tabs in your Worker, go to "Variables", at the end of the page, you will see "KV Namespace Bindings"... add...
Read more >
Environment variables - Workers - Cloudflare Docs
Environment variables. In the Workers platform, environment variables, secrets, and KV namespaces are known as bindings.
Read more >
Cloudflare KV namespace doesn't bind - Stack Overflow
This second parameter holds the environment. You can use and bind to kv with these steps: # Create the KV namespaces wrangler kv:namespace...
Read more >
Recommended Pattern for Vault ACL Policy Path Templates
Commands issued at this prompt are executed on the vault-0 container. Based on the path naming convention, set the CLUSTER_NAME environment value to...
Read more >
2. Spring Cloud Config Server
If {application}/{profile} does not match any of the patterns, it uses the default URI defined under spring.cloud.config.server.git.uri .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found