"[Error: Network connection lost.]"

I have a KV - which I will be used for keeping track of domains, I have assigned it to the Worker, and pasted the toml from the site into my wrangler.toml - everything works fine after I deploy it, and test it there, however, when running locally, I get this:

[Error: Network connection lost.]


Code:
await req.env.DOMAINS.put(body.domain, "-1");


wrangler.toml:
[[kv_namespaces]]
binding = "DOMAINS"
id = ""
preview_id = ""


Everything works fine once deployed, but when using
wrangler dev
, it's throwing the error above
Was this page helpful?