Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare wrangler's getPlatformProxy hangs when run with bun #16240

Open
bndkt opened this issue Jan 8, 2025 · 0 comments
Open

Cloudflare wrangler's getPlatformProxy hangs when run with bun #16240

bndkt opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@bndkt
Copy link

bndkt commented Jan 8, 2025

What version of Bun is running?

1.1.43-canary.107+005cdb2bf

What platform is your computer?

Darwin 24.2.0 arm64 arm

What steps can reproduce the bug?

Cloudflare Wrangler has a getPlatformProxy function that can emulate and proxy Cloudflare Worker capabilities (see their docs. When running getPlatformProxy in Bun, it hangs. I confirmed that it's running fine in Node.js.

I create a reproduction here: https://github.com/bndkt/bun-wrangler-repro

  1. Run bun install in root directory (monorepo)
  2. Run bun dev in host directory
  3. Run bun dev in client directory

Now two wrangler instances are running, the one in client is connecting to a Durable Object that's being served by the one in host.

  1. Stop the wrangler instance in the client directory and run bun dev-bun instead.

This is now running const platform = await getPlatformProxy(); which is supposed to the DO served by the host wrangler as well, but it just hangs.

  1. Stop the Bun instance in the client directory and run bun dev-node instead.

See output from getPlatformProxy(), it works in Node.

platform {
  EXAMPLE_DO: ProxyStub { name: 'DurableObjectNamespace', poisoned: false }
}

Please not that this only happens when a Durable Object is defined, running getPlatformProxy without DOs defined in wrangler.json works fine. Probably because it doesn't even attempt to create any network connections in this case.

What is the expected behavior?

See step 5 above, getPlatformProxy() should run and produce output.

What do you see instead?

getPlatformProxy() hangs indefinitely.

Additional information

No response

@bndkt bndkt added bug Something isn't working needs triage labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant