Unable to write KV values from within Workers

I’m unable to write anything to KV from within workers.

Works fine via API and I’ve tested on different domains and different KV Namespaces.

I know this is in “Beta” but not working at all… ?

Is bind properly to worker script? I had issue in the passed that it failed to bind. It is a dashboard issue.

That’s what i expected, so I tried values that where already bound and then tried with a fresh worker on a separate domain with a simple bind test = namespace. Still the same issue, nothing get written.

After doing some tests, it seems that NOTHING is written if i refresh the workers page a single time.

But, if i refresh it quickly a few times - a single value is written to the KV.

I tested this using a simple: something.put(''+Math.random(), 'hello');

Because at first i thought it took time for the value to be written (eventually consistent) but that is NOT the case.

EDIT: Also, no matter how many times i refresh the Worker Editor or run the Worker Test page, I cannot get it to write a value - I have to load the actual public page for the worker and refresh this page several times for it to write a value to the KV.

I’m guessing someone saw the issue, because now it writes the value on refresh…

I’m still unable to write values using my original domain, even with a fresh KV.

Not sure if this is related to the issue:


Found the issue, it’s because I send a response directly after writing to the KV without await and that completely cancels writing the value.

This wasn’t the case before, but now it is… apparently.

Please update the Docs so others don’t have to pull their hair out.

1 Like

I can absolutely see why that would be exceptionally frustrating! I’m sorry you had to struggle through that @thomas4.

1 Like

No worries, would have been worse if it was a systematic issue.