cloudflare / cloudflare/workers-sdk

Run multiple workers with specific environment on both

Open
#10,350 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
186

Description

I have two workers
Worker A and B

Both workers have the default environment at the top-level as well as a `dev` one.

A includes a binding for B (via RPC)

When running locally, I want to run both at once but using my `dev` env on both

this is the binding from Worker A wrangler
```jsonc
{
"binding": "WORKER_B",
"service": "worker-b-dev"
}
```

using this command to run both at once
```bash
wrangler dev -c ./wrangler.jsonc -c ../worker-b/wrangler.jsonc -e=dev --local --persist-to .wrangler
```

This fails to find worker-b-dev and only works if I change the service binding to `worker-b` (dropping the `-dev`)

I need to keep the `-dev` because when I deploy my dev environment it's named `worker-b-dev`

How can I get it working when running locally?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.