cloudflare / miniflare

🔥 Fully-local simulator for Cloudflare Workers. For the latest version, see https://github.com/cloudflare/workers-sdk/tree/main/packages/miniflare.
https://miniflare.dev
MIT License
3.78k stars 205 forks source link

R2Bucket.put() gets stuck indefinitely in using the `getBindigns()` ProxyStub #670

Closed TimoWilhelm closed 1 year ago

TimoWilhelm commented 1 year ago

After migrating to the new *magic* proxy getBindings() implementation in Miniflare 3, I noticed that storing new blobs in R2 through the proxy stub get stuck indefinitely.

Looking at the .miniflare directory it seems like the blob is uploaded correctly. However, the call never completes and eventually fails with a fetch timeout.

I've included a Minimal, Reproducible Example here https://github.com/TimoWilhelm/mre-miniflare-r2-bindings

Environment

Node: v20.5.1 miniflare: 3.20230821.0

mrbbot commented 1 year ago

Hey! 👋 I think this is the same issue as https://github.com/cloudflare/workers-sdk/issues/3626#issuecomment-1648130455. I think this may be caused by https://github.com/nodejs/node/issues/48668, which was introduced in Node 20.4.0. It looks like Node 20.3.0 doesn't reproduce this issue, so I'd stick with that for the time being. I'll close this issue, since there's not much we can do until the next Node release. 👍 In your reproduction, you'll want to add await mf.dispose() at the end of your script too, so the process can exit cleanly.

TimoWilhelm commented 1 year ago

Thanks for the quick reply 🙌 I must have missed the other issue.