Skip to content

multi-worker wrangler dev incorrect remote bindings deduplication behavior #9842

@dario-piotrowicz

Description

@dario-piotrowicz

What versions & operating system are you using?

[email protected]

Please provide a link to a minimal reproduction

No response

Describe the Bug

Let's say that I have 2 workers, worker-a and worker-b with the following wrangler config files:

// wrangler-a.config.jsonc
{
  "name": "worker-a",
  "compatibility_date": "2025-04-03",
  "main": "./index-a.js",
  "services": [
    {
      "binding": "WORKER_B",
      "service": "worker-b",
      "experimental_remote": true
    }
  ],
  "kv_namespaces": [
    { "binding": "MY_KV", "id": "a4f1b5c514214a02b521ad60419b88db", "experimental_remote": true }
  ]
}
// wrangler-b.config.jsonc
{
  "name": "worker-b",
  "compatibility_date": "2025-04-03",
  "main": "./index-b.js",
  "kv_namespaces": [
    { "binding": "MY_KV", "id": "a4f1b5c514214a02b521ad60419b88db" }
  ]
}

If I then run wrangler dev in the following way:

$ npx wrangler dev -c wrangler-a.config.jsonc -c wrangler-b.config.jsonc --x-remote-bindings

and try to interact with the KV binding in both workers I'll see that both bindings are remote, although the second one should actually be local


This is caused by some deduplication logic we have in Miniflare that causes only the first binding definition to be used

Please provide any relevant error logs

No response

Metadata

Metadata

Labels

bugSomething that isn't working

Type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions