Closed vzaramel closed 10 months ago
Because of how miniflare handles the default export from modules the Proxy returned by wrap.ts is passing through the bind call. And that makes the proxy be bypassed by miniflare.
wrap.ts
https://github.com/cloudflare/miniflare/blob/7e4d906e19cc69cd3446512bfeb7f8aee3a2bda7/packages/core/src/index.ts#L813-L814
Fixed this in a fork adding a case for 'bind' here
proxyHandler.get = (target, prop, receiver) => { if (prop === unwrapSymbol) { return item } else if(prop === 'bind') { return () => receiver } else { if (handler.get) { return handler.get(target, prop, receiver) } else if (autoPassthrough) { return passthroughGet(target, prop) } } }
As I am not sure if that is the proper solution to the problem I will not submit a PR yet.
Apologies for the long delay. This had escaped my attention. I have made the change in the rc.10 release. Could you test it?
rc.10
Because of how miniflare handles the default export from modules the Proxy returned by
wrap.ts
is passing through the bind call. And that makes the proxy be bypassed by miniflare.https://github.com/cloudflare/miniflare/blob/7e4d906e19cc69cd3446512bfeb7f8aee3a2bda7/packages/core/src/index.ts#L813-L814
Fixed this in a fork adding a case for 'bind' here
As I am not sure if that is the proper solution to the problem I will not submit a PR yet.