-
Notifications
You must be signed in to change notification settings - Fork 13
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
"The object has been freed and can't be used anymore" #1
Comments
Forgot to mention that I built what's in master from source (to be sure I had the latest) then manually swapped it into miniflare (and confirmed it was being used.) Still, I may have made a mistake in doing so. |
Hello! 👋 Thanks for raising this. I've just tried this locally and am able to reproduce the error. What's really strange is that I've got tests (for Miniflare) that do almost exactly the same thing that pass. 😕 I'll try investigate this tomorrow. |
This was a fun one. 😅 I used To check whether something was a getObject(arg0) instanceof Promise The problem with this is that Miniflare's I fixed this by patching the (obj instanceof Promise) || (typeof obj === "object" && typeof obj.then === "function") I've published this fix now as |
Yep, that solved it! Thanks for the swift fix 🚀 There's another pattern some folks use to check "instanceof" cross-realm in case you hadn't seen it before: |
Awesome, glad that worked for you! 😃 Thanks for sharing that alternative promise detection code too, I'll switch to it in the next release. |
Looks like for Node.js at least, |
Nice. I had no idea that existed.
… On Aug 22, 2021, at 7:20 AM, MrBBot ***@***.***> wrote:
Looks like for Node.js at least, util.types.isPromise works cross-realm too.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
FWIW I tried throwing this (via vanilla miniflare) at an large and complex project that uses Cloudflare Workers and many (if not all) of my usages induced the
The object has been freed and can't be used anymore
error. I made a minimal reproduction that induces it:The text was updated successfully, but these errors were encountered: