Can't deploy changes – environment exists but "not found"

When I try to deploy a script using:
npx wrangler deploy --env foo

I get the following error:
A request to the Cloudflare API (/accounts/**/workers/scripts/foo) failed.

workers.api.error.environment_not_found [code: 10092]

---

However, the environment very much exists and serving traffic.

I'm using the latest version of wrangler 3.6.0

I've contacted support but no reply in four days.
Was this page helpful?