fix(miniflare): skip named entrypoint for flagship binding in remote mode#13472
Conversation
…mode In remote mode, the flagship binding is backed by a generic proxy worker that only has a default export. The plugin was telling workerd to look for a named entrypoint 'FlagshipBinding' which doesn't exist on it, causing wrangler dev to crash. Skip the named entrypoint in remote mode so workerd uses the default export, which correctly proxies all method calls to the remote service.
🦋 Changeset detectedLatest commit: 8c3b034 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
petebacondarwin
left a comment
There was a problem hiding this comment.
Good spot @roerohan - LGTM.
I wonder if we should create a single remote e2e test to check the happy path for this as a general regression test.
Happy for that to be in a follow up.
Notably the Stream binding has the same problem https://github.com/cloudflare/workers-sdk/pull/13030/changes#r3082741496
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Had the repo open, so updated the stream binding with the same change! |
Summary
wrangler devcrash when using a Flagship binding withremote: trueDetails
In remote mode, the flagship binding is backed by a generic proxy worker that forwards RPC calls to Cloudflare's edge. That proxy worker only has a
defaultexport, but the plugin was telling workerd to look for a named export called"FlagshipBinding"— which doesn't exist on it, causing workerd to fail with:The fix skips the named entrypoint in remote mode so workerd uses the default export instead, which correctly proxies all method calls to the remote service. This matches how the email plugin already handles the same situation for
SendEmailBinding.A picture of a cute animal (not mandatory, but encouraged)