I get missing kv instance while it is already bound on env

Connect with the Workers Community on the Developers Discord, https://discord.cloudflare.com

For any admin possible, page refering is: shurl.pages.dev

Can you explain more about the issue? What is the full error message and what is your wrangler.toml configuration and code?

Hi erisa,

there is no toml on this one.
I just commit changes on github, it redeploys automatically, since created a page using CF Pages UI wizzard connecting repo to page.

Then again I bind kv manually from CF Pages Settings section under functions.

To give extra context: The thing you may not noticed is, I had exact same project using same subdomain from another CF account. Later deleted from that account and created same project (same way) from entirely another CF account.

The full message error is that workers runtime tells that .get function is not accessible on undefined variable (req.env.kv.get)

The code that is not properly functioning are just backend functions which you can browse here publicly: shurl/functions at main · simultsop/shurl · GitHub

For more context, I blogged about this here: Shorten URLs for yourself

There is no env on req, the env is a separate param accessed directly as env

Okay you are right, I just typed it wrong quickly over phone. You can check correct code on the links above.