diff --git a/.changeset/fix-stream-remote-entrypoint.md b/.changeset/fix-stream-remote-entrypoint.md new file mode 100644 index 0000000000..1cdf723fda --- /dev/null +++ b/.changeset/fix-stream-remote-entrypoint.md @@ -0,0 +1,7 @@ +--- +"miniflare": patch +--- + +Fix `wrangler dev` crash when using a Stream binding with `remote: true` + +In remote mode, the Stream binding is backed by a generic proxy worker that only has a default export. The plugin was requesting a named entrypoint `"StreamBinding"` which doesn't exist on it, causing workerd to reject the binding at startup. The named entrypoint is now omitted in remote mode so workerd routes to the default export, which correctly proxies all RPC calls to the remote Stream service. diff --git a/packages/miniflare/src/plugins/stream/index.ts b/packages/miniflare/src/plugins/stream/index.ts index 02853b3957..a921cbe154 100644 --- a/packages/miniflare/src/plugins/stream/index.ts +++ b/packages/miniflare/src/plugins/stream/index.ts @@ -56,7 +56,9 @@ export const STREAM_PLUGIN: Plugin< options.stream.binding, options.stream.remoteProxyConnectionString ), - entrypoint: "StreamBinding", + entrypoint: options.stream.remoteProxyConnectionString + ? undefined + : "StreamBinding", }, }, ];