🐛 BUG: Different workers created for different environments
See original GitHub issueWhat version of Wrangler
are you using?
1.19.12
What operating system are you using?
MacOS 12.3.1
Describe the Bug
Wrangler is adding the environment name to the worker while publishing, which creates separate workers for each environment.
For example, I have a worker named “foo”. wrangler publish --env production
creates a new worker foo-production
and wrangler publish --env staging
creates a new worker foo-staging
.
Reproduce the bug
A list of steps to reproduce the bug.
- Create a new project
wrangler generate foo
. - Add
production
andstaging
environments towrangler.toml
(as below). - Run
wrangler publish --env production
. - Run
wrangler publish --env staging
. - Notice the newly created workers “foo-production” and “foo-staging” both with the production environment.
name = "foo"
type = "javascript"
account_id = ""
workers_dev = true
route = ""
zone_id = ""
compatibility_date = "2022-05-07"
[env.production]
route = "*/*"
[env.staging]
route = "*/*"
Expected behavior
Only a single worker will be created named “foo” with two environments “production” and “staging”. Instead, it’s creating two workers with both of them having a production environment.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Different workers created for different environments #2251
Only a single worker will be created named "foo" with two environments "production" and "staging". Instead, it's creating two workers with both ......
Read more >python - Celery: how to separate different environments with ...
One redis instance as broker (everything in the same database). On the "celery server", I run multiple worker instances through supervisor ( ...
Read more >Solved: How do you handle defects through multiple environ...
Solved: Hello Atlassian/Jira community! I have a question for you today...how do you all handle managing defects through environments? Let me give.
Read more >Environments · Cloudflare Workers docs
The Workers platform allows you to create and manage different environments. Through environments, you can deploy the same project to multiple ...
Read more >Fixing the bugs in activity-based work environments - MultiBriefs
Research he and his colleagues conducted found that organizations often fail to account for differences in individuals' work assignments, work ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is working as designed https://developers.cloudflare.com/workers/platform/environments/#naming.
We also have newer service environments https://developers.cloudflare.com/workers/learning/using-services/ which is a first class abstraction that succeeds the existing environments and would work as you desire, but we’ll enable them by default in wrangler only after they become generally available, which should happen soon later this year.
Can you pls point to the gh-issue that tracks this effort for wrangler2?
Edit: Found it https://github.com/cloudflare/wrangler2/issues/27