ReferenceError: <KV binding variable name> is not defined

Set up KV from dashboard as per docs. Added KV Namespace Binding. Still get the error above with both put and get.

It sounds like your binding isn’t going through. Can you share your wrangler.toml file and your code? It might be quicker to join the Developer Discord Server and as there.

I’m following the docs for the dashboard, not wrangler. The code is the default with this bit added at the bottom:

const value = await <KV binding variable name>.get(“<key>”);

Where are you editing the worker? Are you using the quick edit?

Yes I am.
I think I got it. It’s the env’s that were missing.
Thanks.